From: Daniel Golle Date: Thu, 22 Dec 2022 19:33:04 +0000 (+0000) Subject: mtd: ubi: wire-up parent MTD device X-Git-Tag: v6.6.17~5391^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1ecf9e390452e73a362ea7fbde8f3f0db83de856;p=platform%2Fkernel%2Flinux-rpi.git 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 Signed-off-by: Richard Weinberger --- diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c index 5e90a44..0904eb4 100644 --- a/drivers/mtd/ubi/build.c +++ b/drivers/mtd/ubi/build.c @@ -915,6 +915,7 @@ int ubi_attach_mtd_dev(struct mtd_info *mtd, int ubi_num, ubi->dev.release = dev_release; ubi->dev.class = &ubi_class; ubi->dev.groups = ubi_dev_groups; + ubi->dev.parent = &mtd->dev; ubi->mtd = mtd; ubi->ubi_num = ubi_num;