mirror of
https://github.com/AuxXxilium/linux_dsm_epyc7002.git
synced 2024-12-16 01:36:42 +07:00
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>
This commit is contained in:
parent
7db782bc18
commit
0e210b542c
@ -1470,8 +1470,7 @@ static struct docg3 *sysfs_dev2docg3(struct device *dev,
|
||||
struct device_attribute *attr)
|
||||
{
|
||||
int floor;
|
||||
struct platform_device *pdev = to_platform_device(dev);
|
||||
struct mtd_info **docg3_floors = platform_get_drvdata(pdev);
|
||||
struct mtd_info **docg3_floors = dev_get_drvdata(dev);
|
||||
|
||||
floor = attr->attr.name[1] - '0';
|
||||
if (floor < 0 || floor >= DOC_MAX_NBFLOORS)
|
||||
|
Loading…
Reference in New Issue
Block a user