drivers: rename-block: support DP and No DP configuration

Supporting renaming of partitions in DP and NON DP Configurations.

Change-Id: I1908d7e76157fa3e31378ea2981669379b2fca6b
Signed-off-by: Venkata Rao Kakani <vkakani@codeaurora.org>
This commit is contained in:
Venkata Rao Kakani 2021-05-28 18:29:50 +05:30
parent 0611102d4e
commit ede7e59086

View File

@ -66,21 +66,22 @@ static int rename_blk_dev_init(void)
dev = name_to_dev_t(dev_path);
if (!dev) {
pr_err("No device path : %s\n", dev_path);
return -EINVAL;
goto out;
}
disk = get_gendisk(dev, &partno);
if (!disk) {
pr_err("No device with dev path : %s\n", dev_path);
return -ENXIO;
goto out;
}
if (!of_property_read_string_index(node, "rename-dev", index,
(const char **)&modified_name)) {
if (!of_property_read_string_index(node, dp_enabled ?
"rename-dev-ab" : "rename-dev",
index, (const char **)&modified_name)) {
get_slot_updated_name(modified_name);
device_rename(disk_to_dev(disk), final_name);
} else {
pr_err("rename-dev for actual-dev = %s is missing\n",
actual_name);
return -ENXIO;
goto out;
}
index++;
}