Skip to content

Commit 1ecf9e3

Browse files
dangowrtrichardweinberger
authored andcommitted
mtd: ubi: wire-up parent MTD device
Wire up the device parent pointer of UBI devices to their lower MTD device, typically an MTD partition or whole-chip device. The most noticeable change is that in sysfs, previously ubi devices would be could in /sys/devices/virtual/ubi while after this change they would be correctly attached to their parent MTD device, e.g. /sys/devices/platform/1100d000.spi/spi_master/spi1/spi1.0/mtd/mtd2/ubi0. Locating UBI devices using /sys/class/ubi/ of course still works as well. Signed-off-by: Daniel Golle <[email protected]> Signed-off-by: Richard Weinberger <[email protected]>
1 parent 0b3bc49 commit 1ecf9e3

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/mtd/ubi/build.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -915,6 +915,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num,
915915
ubi->dev.release = dev_release;
916916
ubi->dev.class = &ubi_class;
917917
ubi->dev.groups = ubi_dev_groups;
918+
ubi->dev.parent = &mtd->dev;
918919

919920
ubi->mtd = mtd;
920921
ubi->ubi_num = ubi_num;

0 commit comments

Comments
 (0)