From 5326c14af0ba440aa33e66f9c9a0491c12dc6ac0 Mon Sep 17 00:00:00 2001 From: Ruixuan Li Date: Mon, 3 Dec 2018 15:21:30 +0800 Subject: [PATCH] emmc: modify device node name [1/1] PD#SWPL-2719 Problem: Can't idetify correctlly when move disk have multi partition Solution: Remove the function of using the partition name as the device node name Verify: test pass on tl1 ref board Change-Id: I113e63f209c529149fb94b0bb10b0b254717c2bf Signed-off-by: Ruixuan Li --- block/partition-generic.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/block/partition-generic.c b/block/partition-generic.c index d2582d8..736f5b9 100644 --- a/block/partition-generic.c +++ b/block/partition-generic.c @@ -25,7 +25,6 @@ extern void md_autodetect_dev(dev_t dev); #endif -#define AMLOGIC_ADD_PARTITION /* * disk_name() is used by partition check code and the genhd driver. * It formats the devicename of the indicated disk into @@ -290,10 +289,9 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, struct disk_part_tbl *ptbl; const char *dname; int err; -#ifdef AMLOGIC_ADD_PARTITION - char *info_name = NULL; -#endif + err = disk_expand_part_tbl(disk, partno); + if (err) return ERR_PTR(err); ptbl = disk->part_tbl; @@ -334,24 +332,10 @@ struct hd_struct *add_partition(struct gendisk *disk, int partno, dname = dev_name(ddev); -#ifdef AMLOGIC_ADD_PARTITION - if (info) { - info_name = (char *)info->volname; - } - - if (info_name && (strlen(info_name) > 1)) { - dname = (char *)info->volname; - dev_set_name(pdev, "%s", dname); - } else if (isdigit(dname[strlen(dname) - 1])) - dev_set_name(pdev, "%sp%d", dname, partno); - else - dev_set_name(pdev, "%s%d", dname, partno); -#else if (isdigit(dname[strlen(dname) - 1])) dev_set_name(pdev, "%sp%d", dname, partno); else dev_set_name(pdev, "%s%d", dname, partno); -#endif device_initialize(pdev); pdev->class = &block_class; -- 2.7.4