summaryrefslogtreecommitdiff
authorRuixuan Li <ruixuan.li@amlogic.com>2018-12-03 07:21:30 (GMT)
committer Ruixuan Li <ruixuan.li@amlogic.com>2018-12-11 06:31:06 (GMT)
commit1407ac534a8411e351a80ae2839ef0ae5aa7ae7d (patch)
treecc57ee7fd99a9fcdc902587e555f6e376289c5b4
parentc2d57993248974b13c4922278b68315bf2f79835 (diff)
downloadcommon-1407ac534a8411e351a80ae2839ef0ae5aa7ae7d.zip
common-1407ac534a8411e351a80ae2839ef0ae5aa7ae7d.tar.gz
common-1407ac534a8411e351a80ae2839ef0ae5aa7ae7d.tar.bz2
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 <ruixuan.li@amlogic.com>
Diffstat
-rw-r--r--block/partition-generic.c20
1 files 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;