lkml.org 
[lkml]   [2022]   [Dec]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    Subject[PATCH 1/2] 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 <daniel@makrotopia.org>
    ---
    drivers/mtd/ubi/build.c | 1 +
    1 file changed, 1 insertion(+)

    diff --git a/drivers/mtd/ubi/build.c b/drivers/mtd/ubi/build.c
    index 5e90a4423b699..0904eb40c95fa 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;
    --
    2.39.0
    \
     
     \ /
      Last update: 2023-03-26 23:18    [W:6.292 / U:0.036 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site