emmc: modify device node name [1/1]
authorRuixuan Li <ruixuan.li@amlogic.com>
Mon, 3 Dec 2018 07:21:30 +0000 (15:21 +0800)
committerRuixuan Li <ruixuan.li@amlogic.com>
Tue, 11 Dec 2018 06:31:06 +0000 (14:31 +0800)
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 <ruixuan.li@amlogic.com>
block/partition-generic.c

index d2582d8..736f5b9 100644 (file)
@@ -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;