aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2018-04-19 10:05:59 -0400
committerBoris Brezillon <boris.brezillon@bootlin.com>2018-04-22 13:10:53 -0400
commit0e210b542cdb34637b849e181178c2d27fcf0d28 (patch)
tree8e349a7ff721cee87fa6de8ef76f43359181744c
parent7db782bc180efabf6d6628d428be163dc19513ad (diff)
mtd: devices: simplify getting .drvdata
We should get drvdata from struct device directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com> Acked-by: Robert Jarzmik <robert.jarzmik@free.fr> Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
-rw-r--r--drivers/mtd/devices/docg3.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/mtd/devices/docg3.c b/drivers/mtd/devices/docg3.c
index c594fe5eac08..802d8f159e90 100644
--- a/drivers/mtd/devices/docg3.c
+++ b/drivers/mtd/devices/docg3.c
@@ -1470,8 +1470,7 @@ static struct docg3 *sysfs_dev2docg3(struct device *dev,
1470 struct device_attribute *attr) 1470 struct device_attribute *attr)
1471{ 1471{
1472 int floor; 1472 int floor;
1473 struct platform_device *pdev = to_platform_device(dev); 1473 struct mtd_info **docg3_floors = dev_get_drvdata(dev);
1474 struct mtd_info **docg3_floors = platform_get_drvdata(pdev);
1475 1474
1476 floor = attr->attr.name[1] - '0'; 1475 floor = attr->attr.name[1] - '0';
1477 if (floor < 0 || floor >= DOC_MAX_NBFLOORS) 1476 if (floor < 0 || floor >= DOC_MAX_NBFLOORS)