mtd: maps: use platform_{get,set}_drvdata()
PATCH 1/1 mtd: maps: use platform_{get,set}_drvdata()
Use the wrapper functions for getting and setting the driver data using platform_device instead of using dev_{get,set}_drvdata() with &pdev->dev, so we can directly pass a struct platform_device.
Signed-off-by Jingoo Han <[email protected]>
--- drivers/mtd/maps/physmap_of.c | 5 ++--- drivers/mtd/maps/sun_uflash.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-)
drivers/mtd/maps/physmap_of.c +2 -3
@@ -43,10 +43,9 @@ static int of_flash_remove(struct platform_device *dev)struct of_flash *info;int i; - info =dev_get_drvdata (&dev->dev); + info =platform_get_drvdata (dev);if (!info)return 0 ; -dev_set_drvdata (&dev->dev,NULL );if (info->cmtd != info->list[0 ].mtd) {mtd_device_unregister (info->cmtd);
@@ -204,7 +203,7 @@ static int of_flash_probe(struct platform_device *dev)if (!info) goto err_flash_remove; -dev_set_drvdata (&dev->dev, info); +platform_set_drvdata (dev, info); mtd_list =kzalloc (sizeof (*mtd_list) * count,GFP_KERNEL );if (!mtd_list)
drivers/mtd/maps/sun_uflash.c +2 -2
@@ -103,7 +103,7 @@ int uflash_devinit(struct platform_device *op, struct device_node *dp)mtd_device_register (up->mtd,NULL ,0 ); -dev_set_drvdata (&op->dev, up); +platform_set_drvdata (op, up);return 0 ; }
@@ -123,7 +123,7 @@ static int uflash_probe(struct platform_device *op)static int uflash_remove (struct platform_device *op) { -struct uflash_dev *up =dev_get_drvdata (&op->dev); +struct uflash_dev *up =platform_get_drvdata (op);if (up->mtd) {mtd_device_unregister (up->mtd);
Signature · 1 line
1.7.10.4