Skip to content

Commit

Permalink
mtd: core: tone down suggestion that dev.parent should be set
Browse files Browse the repository at this point in the history
add_mtd_device() has a comment suggesting that the caller should have
set dev.parent. This is required to have the parent device symlink show
up in sysfs, but not for proper operation of the mtd device itself.
Currently we have five drivers registering mtd devices during module
initialization, so they don't actually provide a parent device to link
to. That means we cannot WARN_ON() here, as it would trigger false
positives.

Make the comment a bit less firm in its assertion that dev.parent should
be set.

Signed-off-by: Frans Klaver <fransklaver@gmail.com>
Signed-off-by: Brian Norris <computersforpeace@gmail.com>
  • Loading branch information
Frans Klaver authored and Brian Norris committed Oct 13, 2015
1 parent f9bcb6d commit 260e89a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/mtd/mtdcore.c
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ int add_mtd_device(struct mtd_info *mtd)
}

/* Caller should have set dev.parent to match the
* physical device.
* physical device, if appropriate.
*/
mtd->dev.type = &mtd_devtype;
mtd->dev.class = &mtd_class;
Expand Down

0 comments on commit 260e89a

Please sign in to comment.