mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-06 10:58:48 +09:00
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user