Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

misc: 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 <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Jingoo Han and committed by
Greg Kroah-Hartman
9093ca88 c6148f8f

+9 -9
+2 -2
drivers/misc/carma/carma-fpga-program.c
··· 919 919 920 920 static int fpga_of_remove(struct platform_device *op) 921 921 { 922 - struct fpga_dev *priv = dev_get_drvdata(&op->dev); 922 + struct fpga_dev *priv = platform_get_drvdata(op); 923 923 struct device *this_device = priv->miscdev.this_device; 924 924 925 925 sysfs_remove_group(&this_device->kobj, &fpga_attr_group); ··· 969 969 970 970 kref_init(&priv->ref); 971 971 972 - dev_set_drvdata(&op->dev, priv); 972 + platform_set_drvdata(op, priv); 973 973 priv->dev = &op->dev; 974 974 mutex_init(&priv->lock); 975 975 init_completion(&priv->completion);
+2 -2
drivers/misc/carma/carma-fpga.c
··· 1296 1296 goto out_return; 1297 1297 } 1298 1298 1299 - dev_set_drvdata(&op->dev, priv); 1299 + platform_set_drvdata(op, priv); 1300 1300 priv->dev = &op->dev; 1301 1301 kref_init(&priv->ref); 1302 1302 mutex_init(&priv->mutex); ··· 1400 1400 1401 1401 static int data_of_remove(struct platform_device *op) 1402 1402 { 1403 - struct fpga_device *priv = dev_get_drvdata(&op->dev); 1403 + struct fpga_device *priv = platform_get_drvdata(op); 1404 1404 struct device *this_device = priv->miscdev.this_device; 1405 1405 1406 1406 /* remove all sysfs files, now the device cannot be re-enabled */
+2 -2
drivers/misc/spear13xx_pcie_gadget.c
··· 776 776 goto err_iounmap_app; 777 777 } 778 778 779 - dev_set_drvdata(&pdev->dev, target); 779 + platform_set_drvdata(pdev, target); 780 780 781 781 irq = platform_get_irq(pdev, 0); 782 782 if (irq < 0) { ··· 863 863 res0 = platform_get_resource(pdev, IORESOURCE_MEM, 0); 864 864 res1 = platform_get_resource(pdev, IORESOURCE_MEM, 1); 865 865 irq = platform_get_irq(pdev, 0); 866 - target = dev_get_drvdata(&pdev->dev); 866 + target = platform_get_drvdata(pdev); 867 867 config = &target->config; 868 868 869 869 free_irq(irq, NULL);
+3 -3
drivers/misc/ti-st/st_kim.c
··· 680 680 *core_data = NULL; 681 681 return; 682 682 } 683 - kim_gdata = dev_get_drvdata(&pdev->dev); 683 + kim_gdata = platform_get_drvdata(pdev); 684 684 *core_data = kim_gdata->core_data; 685 685 } 686 686 ··· 735 735 pr_err("no mem to allocate"); 736 736 return -ENOMEM; 737 737 } 738 - dev_set_drvdata(&pdev->dev, kim_gdata); 738 + platform_set_drvdata(pdev, kim_gdata); 739 739 740 740 err = st_core_init(&kim_gdata->core_data); 741 741 if (err != 0) { ··· 810 810 struct ti_st_plat_data *pdata = pdev->dev.platform_data; 811 811 struct kim_data_s *kim_gdata; 812 812 813 - kim_gdata = dev_get_drvdata(&pdev->dev); 813 + kim_gdata = platform_get_drvdata(pdev); 814 814 815 815 /* Free the Bluetooth/FM/GPIO 816 816 * nShutdown gpio from the system