USB: host: use dev_get_platdata()
authorJingoo Han <jg1.han@samsung.com>
Tue, 30 Jul 2013 10:59:40 +0000 (19:59 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 1 Aug 2013 00:53:50 +0000 (17:53 -0700)
Use the wrapper function for retrieving the platform data instead of
accessing dev->platform_data directly.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
26 files changed:
drivers/usb/host/ehci-fsl.c
drivers/usb/host/ehci-mv.c
drivers/usb/host/ehci-mxc.c
drivers/usb/host/ehci-omap.c
drivers/usb/host/ehci-orion.c
drivers/usb/host/ehci-platform.c
drivers/usb/host/ehci-s5p.c
drivers/usb/host/ehci-sh.c
drivers/usb/host/ehci-tegra.c
drivers/usb/host/ehci-tilegx.c
drivers/usb/host/fsl-mph-dr-of.c
drivers/usb/host/imx21-hcd.c
drivers/usb/host/isp116x-hcd.c
drivers/usb/host/isp1362-hcd.c
drivers/usb/host/isp1760-if.c
drivers/usb/host/ohci-at91.c
drivers/usb/host/ohci-da8xx.c
drivers/usb/host/ohci-exynos.c
drivers/usb/host/ohci-omap.c
drivers/usb/host/ohci-platform.c
drivers/usb/host/ohci-pxa27x.c
drivers/usb/host/ohci-s3c2410.c
drivers/usb/host/ohci-tilegx.c
drivers/usb/host/r8a66597-hcd.c
drivers/usb/host/sl811-hcd.c
drivers/usb/host/u132-hcd.c

index bd831ec06dcd8b8192749bc31d4afd137ab361bf..45eee6e9c6c858630f8d8a3a75a2d01a869917f2 100644 (file)
@@ -57,7 +57,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
        pr_debug("initializing FSL-SOC USB Controller\n");
 
        /* Need platform data for setup */
-       pdata = (struct fsl_usb2_platform_data *)pdev->dev.platform_data;
+       pdata = (struct fsl_usb2_platform_data *)dev_get_platdata(&pdev->dev);
        if (!pdata) {
                dev_err(&pdev->dev,
                        "No platform data for %s.\n", dev_name(&pdev->dev));
@@ -190,7 +190,7 @@ static int usb_hcd_fsl_probe(const struct hc_driver *driver,
 static void usb_hcd_fsl_remove(struct usb_hcd *hcd,
                               struct platform_device *pdev)
 {
-       struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
+       struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
        if (!IS_ERR_OR_NULL(hcd->phy)) {
                otg_set_host(hcd->phy->otg, NULL);
@@ -218,7 +218,7 @@ static int ehci_fsl_setup_phy(struct usb_hcd *hcd,
        struct ehci_hcd *ehci = hcd_to_ehci(hcd);
        void __iomem *non_ehci = hcd->regs;
        struct device *dev = hcd->self.controller;
-       struct fsl_usb2_platform_data *pdata = dev->platform_data;
+       struct fsl_usb2_platform_data *pdata = dev_get_platdata(dev);
 
        if (pdata->controller_ver < 0) {
                dev_warn(hcd->self.controller, "Could not get controller version\n");
@@ -291,7 +291,7 @@ static int ehci_fsl_usb_setup(struct ehci_hcd *ehci)
        struct fsl_usb2_platform_data *pdata;
        void __iomem *non_ehci = hcd->regs;
 
-       pdata = hcd->self.controller->platform_data;
+       pdata = dev_get_platdata(hcd->self.controller);
 
        if (pdata->have_sysif_regs) {
                /*
@@ -363,7 +363,7 @@ static int ehci_fsl_setup(struct usb_hcd *hcd)
        struct device *dev;
 
        dev = hcd->self.controller;
-       pdata = hcd->self.controller->platform_data;
+       pdata = dev_get_platdata(hcd->self.controller);
        ehci->big_endian_desc = pdata->big_endian_desc;
        ehci->big_endian_mmio = pdata->big_endian_mmio;
 
@@ -415,7 +415,7 @@ static int ehci_fsl_mpc512x_drv_suspend(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct ehci_hcd *ehci = hcd_to_ehci(hcd);
-       struct fsl_usb2_platform_data *pdata = dev->platform_data;
+       struct fsl_usb2_platform_data *pdata = dev_get_platdata(dev);
        u32 tmp;
 
 #ifdef DEBUG
@@ -484,7 +484,7 @@ static int ehci_fsl_mpc512x_drv_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct ehci_hcd *ehci = hcd_to_ehci(hcd);
-       struct fsl_usb2_platform_data *pdata = dev->platform_data;
+       struct fsl_usb2_platform_data *pdata = dev_get_platdata(dev);
        u32 tmp;
 
        dev_dbg(dev, "suspend=%d already_suspended=%d\n",
index 915c2db96dce8fdc3dded7b17915e501367f356e..35cdbd88bbbef62a93a3aa869c12dbfda8183bf2 100644 (file)
@@ -131,7 +131,7 @@ static const struct hc_driver mv_ehci_hc_driver = {
 
 static int mv_ehci_probe(struct platform_device *pdev)
 {
-       struct mv_usb_platform_data *pdata = pdev->dev.platform_data;
+       struct mv_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct usb_hcd *hcd;
        struct ehci_hcd *ehci;
        struct ehci_hcd_mv *ehci_mv;
index 030b539588458e2325cdf4dba59ad86140a0e570..5899ad6626c7525feafc68d712de54906355c5cc 100644 (file)
@@ -49,7 +49,7 @@ static const struct ehci_driver_overrides ehci_mxc_overrides __initconst = {
 
 static int ehci_mxc_drv_probe(struct platform_device *pdev)
 {
-       struct mxc_usbh_platform_data *pdata = pdev->dev.platform_data;
+       struct mxc_usbh_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct usb_hcd *hcd;
        struct resource *res;
        int irq, ret;
@@ -174,7 +174,7 @@ err_alloc:
 
 static int ehci_mxc_drv_remove(struct platform_device *pdev)
 {
-       struct mxc_usbh_platform_data *pdata = pdev->dev.platform_data;
+       struct mxc_usbh_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct usb_hcd *hcd = platform_get_drvdata(pdev);
        struct ehci_hcd *ehci = hcd_to_ehci(hcd);
        struct ehci_mxc_priv *priv = (struct ehci_mxc_priv *) ehci->priv;
index 4384d07115d15e4e19297fbb0aec01a91dab71e5..78b01fa475bbfc85e0aa35fcd9ab917b963689ee 100644 (file)
@@ -100,7 +100,7 @@ static const struct ehci_driver_overrides ehci_omap_overrides __initdata = {
 static int ehci_hcd_omap_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct usbhs_omap_platform_data *pdata = dev->platform_data;
+       struct usbhs_omap_platform_data *pdata = dev_get_platdata(dev);
        struct resource *res;
        struct usb_hcd  *hcd;
        void __iomem *regs;
@@ -119,7 +119,7 @@ static int ehci_hcd_omap_probe(struct platform_device *pdev)
 
        /* For DT boot, get platform data from parent. i.e. usbhshost */
        if (dev->of_node) {
-               pdata = dev->parent->platform_data;
+               pdata = dev_get_platdata(dev->parent);
                dev->platform_data = pdata;
        }
 
index 1a450aa13ebf04aaa3b8fef5ce9e296412b89373..d1dfb9db5b420845edec3a30b81bdd30792704e9 100644 (file)
@@ -139,7 +139,7 @@ ehci_orion_conf_mbus_windows(struct usb_hcd *hcd,
 
 static int ehci_orion_drv_probe(struct platform_device *pdev)
 {
-       struct orion_ehci_data *pd = pdev->dev.platform_data;
+       struct orion_ehci_data *pd = dev_get_platdata(&pdev->dev);
        const struct mbus_dram_target_info *dram;
        struct resource *res;
        struct usb_hcd *hcd;
index 5196d728517d03474270888adbfd98fb9ab73d4c..f6b790ca8cf2415805d827fcceebbde48291a935 100644 (file)
@@ -39,7 +39,7 @@ static const char hcd_name[] = "ehci-platform";
 static int ehci_platform_reset(struct usb_hcd *hcd)
 {
        struct platform_device *pdev = to_platform_device(hcd->self.controller);
-       struct usb_ehci_pdata *pdata = pdev->dev.platform_data;
+       struct usb_ehci_pdata *pdata = dev_get_platdata(&pdev->dev);
        struct ehci_hcd *ehci = hcd_to_ehci(hcd);
        int retval;
 
@@ -87,14 +87,14 @@ static int ehci_platform_probe(struct platform_device *dev)
         * use reasonable defaults so platforms don't have to provide these.
         * with DT probing on ARM, none of these are set.
         */
-       if (!dev->dev.platform_data)
+       if (!dev_get_platdata(&dev->dev))
                dev->dev.platform_data = &ehci_platform_defaults;
        if (!dev->dev.dma_mask)
                dev->dev.dma_mask = &dev->dev.coherent_dma_mask;
        if (!dev->dev.coherent_dma_mask)
                dev->dev.coherent_dma_mask = DMA_BIT_MASK(32);
 
-       pdata = dev->dev.platform_data;
+       pdata = dev_get_platdata(&dev->dev);
 
        irq = platform_get_irq(dev, 0);
        if (irq < 0) {
@@ -148,7 +148,7 @@ err_power:
 static int ehci_platform_remove(struct platform_device *dev)
 {
        struct usb_hcd *hcd = platform_get_drvdata(dev);
-       struct usb_ehci_pdata *pdata = dev->dev.platform_data;
+       struct usb_ehci_pdata *pdata = dev_get_platdata(&dev->dev);
 
        usb_remove_hcd(hcd);
        usb_put_hcd(hcd);
@@ -167,7 +167,7 @@ static int ehci_platform_remove(struct platform_device *dev)
 static int ehci_platform_suspend(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
-       struct usb_ehci_pdata *pdata = dev->platform_data;
+       struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
        struct platform_device *pdev =
                container_of(dev, struct platform_device, dev);
        bool do_wakeup = device_may_wakeup(dev);
@@ -184,7 +184,7 @@ static int ehci_platform_suspend(struct device *dev)
 static int ehci_platform_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
-       struct usb_ehci_pdata *pdata = dev->platform_data;
+       struct usb_ehci_pdata *pdata = dev_get_platdata(dev);
        struct platform_device *pdev =
                container_of(dev, struct platform_device, dev);
 
index aba645bd4866b27bf5d0e11124cf33f1997aeecf..7c3de95c7054339a5f62b64322f55a24f2bb286b 100644 (file)
@@ -75,7 +75,7 @@ static void s5p_setup_vbus_gpio(struct platform_device *pdev)
 
 static int s5p_ehci_probe(struct platform_device *pdev)
 {
-       struct s5p_ehci_platdata *pdata = pdev->dev.platform_data;
+       struct s5p_ehci_platdata *pdata = dev_get_platdata(&pdev->dev);
        struct s5p_ehci_hcd *s5p_ehci;
        struct usb_hcd *hcd;
        struct ehci_hcd *ehci;
index c4c0ee92a397b7172b9ecd04da481079ac272801..93e59a13bc1fec919ef81690bbce9f4bdcd3e951 100644 (file)
@@ -104,7 +104,7 @@ static int ehci_hcd_sh_probe(struct platform_device *pdev)
                goto fail_create_hcd;
        }
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
 
        /* initialize hcd */
        hcd = usb_create_hcd(&ehci_sh_hc_driver, &pdev->dev,
index 6ee7ef79b4f86a5c802e33245592d40ec27127a5..5cd33cf783da926881bded643e785f7328e8cac7 100644 (file)
@@ -361,7 +361,7 @@ static int tegra_ehci_probe(struct platform_device *pdev)
        struct device_node *np_phy;
        struct usb_phy *u_phy;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {
                dev_err(&pdev->dev, "Platform data missing\n");
                return -EINVAL;
index d72b2929c03db50e103ee3f481694001fddae3c1..cca4be90a864dba009c852f606653fb5fe60d568 100644 (file)
@@ -101,7 +101,7 @@ static int ehci_hcd_tilegx_drv_probe(struct platform_device *pdev)
 {
        struct usb_hcd *hcd;
        struct ehci_hcd *ehci;
-       struct tilegx_usb_platform_data *pdata = pdev->dev.platform_data;
+       struct tilegx_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
        pte_t pte = { 0 };
        int my_cpu = smp_processor_id();
        int ret;
@@ -186,7 +186,7 @@ err_hcd:
 static int ehci_hcd_tilegx_drv_remove(struct platform_device *pdev)
 {
        struct usb_hcd *hcd = platform_get_drvdata(pdev);
-       struct tilegx_usb_platform_data *pdata = pdev->dev.platform_data;
+       struct tilegx_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
        usb_remove_hcd(hcd);
        usb_put_hcd(hcd);
index 11e0b79ff9d52a8d703c3b2134b8960768123246..cfbff7161828005c6ea3732f30e452563c238d9e 100644 (file)
@@ -258,7 +258,7 @@ static int fsl_usb2_mph_dr_of_remove(struct platform_device *ofdev)
 
 int fsl_usb2_mpc5121_init(struct platform_device *pdev)
 {
-       struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
+       struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
        struct clk *clk;
        char clk_name[10];
        int base, clk_num;
@@ -298,7 +298,7 @@ int fsl_usb2_mpc5121_init(struct platform_device *pdev)
 
 static void fsl_usb2_mpc5121_exit(struct platform_device *pdev)
 {
-       struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
+       struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
        pdata->regs = NULL;
 
index 03dc4d9cbeca811e156d8e5ed32c235a20129177..60a5de505ca1845609fe34278405e752ddf73226 100644 (file)
@@ -1860,7 +1860,7 @@ static int imx21_probe(struct platform_device *pdev)
        imx21 = hcd_to_imx21(hcd);
        imx21->hcd = hcd;
        imx21->dev = &pdev->dev;
-       imx21->pdata = pdev->dev.platform_data;
+       imx21->pdata = dev_get_platdata(&pdev->dev);
        if (!imx21->pdata)
                imx21->pdata = &default_pdata;
 
index b64e661618bb8842bea5ad02f3d8444453a71c9b..c7d0f8f231be6abcc136b7110a1150f7ca372751 100644 (file)
@@ -1626,7 +1626,7 @@ static int isp116x_probe(struct platform_device *pdev)
        isp116x->addr_reg = addr_reg;
        spin_lock_init(&isp116x->lock);
        INIT_LIST_HEAD(&isp116x->async);
-       isp116x->board = pdev->dev.platform_data;
+       isp116x->board = dev_get_platdata(&pdev->dev);
 
        if (!isp116x->board) {
                ERR("Platform data structure not initialized\n");
index c15463b898e22fd1d83798811ca6ed5c57fe9d67..6f29abad6815578a6282eb6e6d9cbe3b6469a8d8 100644 (file)
@@ -2725,7 +2725,7 @@ static int isp1362_probe(struct platform_device *pdev)
        INIT_LIST_HEAD(&isp1362_hcd->periodic);
        INIT_LIST_HEAD(&isp1362_hcd->isoc);
        INIT_LIST_HEAD(&isp1362_hcd->remove_list);
-       isp1362_hcd->board = pdev->dev.platform_data;
+       isp1362_hcd->board = dev_get_platdata(&pdev->dev);
 #if USE_PLATFORM_DELAY
        if (!isp1362_hcd->board->delay) {
                dev_err(hcd->self.controller, "No platform delay function given\n");
index 3df49b169b531f730cfc4c0cf33c8d7dd27a42d6..df931e9ba5b5cfa682f8fab3272da16c5531dca4 100644 (file)
@@ -351,7 +351,7 @@ static int isp1760_plat_probe(struct platform_device *pdev)
        struct resource *mem_res;
        struct resource *irq_res;
        resource_size_t mem_size;
-       struct isp1760_platform_data *priv = pdev->dev.platform_data;
+       struct isp1760_platform_data *priv = dev_get_platdata(&pdev->dev);
        unsigned int devflags = 0;
        unsigned long irqflags = IRQF_SHARED;
 
index 9677f6831209709d8ea7c42b97c91af3959c000d..a87564559e030d8c30dcd993707941269d363782 100644 (file)
@@ -225,7 +225,7 @@ static void usb_hcd_at91_remove(struct usb_hcd *hcd,
 static int
 ohci_at91_reset (struct usb_hcd *hcd)
 {
-       struct at91_usbh_data   *board = hcd->self.controller->platform_data;
+       struct at91_usbh_data   *board = dev_get_platdata(hcd->self.controller);
        struct ohci_hcd         *ohci = hcd_to_ohci (hcd);
        int                     ret;
 
@@ -280,7 +280,7 @@ static int ohci_at91_usb_get_power(struct at91_usbh_data *pdata, int port)
  */
 static int ohci_at91_hub_status_data(struct usb_hcd *hcd, char *buf)
 {
-       struct at91_usbh_data *pdata = hcd->self.controller->platform_data;
+       struct at91_usbh_data *pdata = dev_get_platdata(hcd->self.controller);
        int length = ohci_hub_status_data(hcd, buf);
        int port;
 
@@ -301,7 +301,7 @@ static int ohci_at91_hub_status_data(struct usb_hcd *hcd, char *buf)
 static int ohci_at91_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                                 u16 wIndex, char *buf, u16 wLength)
 {
-       struct at91_usbh_data *pdata = hcd->self.controller->platform_data;
+       struct at91_usbh_data *pdata = dev_get_platdata(hcd->self.controller);
        struct usb_hub_descriptor *desc;
        int ret = -EINVAL;
        u32 *data = (u32 *)buf;
@@ -461,7 +461,7 @@ static const struct hc_driver ohci_at91_hc_driver = {
 static irqreturn_t ohci_hcd_at91_overcurrent_irq(int irq, void *data)
 {
        struct platform_device *pdev = data;
-       struct at91_usbh_data *pdata = pdev->dev.platform_data;
+       struct at91_usbh_data *pdata = dev_get_platdata(&pdev->dev);
        int val, gpio, port;
 
        /* From the GPIO notifying the over-current situation, find
@@ -567,7 +567,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
        if (ret)
                return ret;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
 
        if (pdata) {
                at91_for_each_port(i) {
@@ -643,7 +643,7 @@ static int ohci_hcd_at91_drv_probe(struct platform_device *pdev)
 
 static int ohci_hcd_at91_drv_remove(struct platform_device *pdev)
 {
-       struct at91_usbh_data   *pdata = pdev->dev.platform_data;
+       struct at91_usbh_data   *pdata = dev_get_platdata(&pdev->dev);
        int                     i;
 
        if (pdata) {
index 6aaa9c9c8eb00f90d3f99711196659991aca2f43..9be59f11e05101356c2b2e44b6b59c3cc7af88be 100644 (file)
@@ -85,7 +85,7 @@ static void ohci_da8xx_ocic_handler(struct da8xx_ohci_root_hub *hub,
 static int ohci_da8xx_init(struct usb_hcd *hcd)
 {
        struct device *dev              = hcd->self.controller;
-       struct da8xx_ohci_root_hub *hub = dev->platform_data;
+       struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
        struct ohci_hcd *ohci           = hcd_to_ohci(hcd);
        int result;
        u32 rh_a;
@@ -171,7 +171,7 @@ static int ohci_da8xx_hub_control(struct usb_hcd *hcd, u16 typeReq, u16 wValue,
                                  u16 wIndex, char *buf, u16 wLength)
 {
        struct device *dev              = hcd->self.controller;
-       struct da8xx_ohci_root_hub *hub = dev->platform_data;
+       struct da8xx_ohci_root_hub *hub = dev_get_platdata(dev);
        int temp;
 
        switch (typeReq) {
@@ -292,7 +292,7 @@ static const struct hc_driver ohci_da8xx_hc_driver = {
 static int usb_hcd_da8xx_probe(const struct hc_driver *driver,
                               struct platform_device *pdev)
 {
-       struct da8xx_ohci_root_hub *hub = pdev->dev.platform_data;
+       struct da8xx_ohci_root_hub *hub = dev_get_platdata(&pdev->dev);
        struct usb_hcd  *hcd;
        struct resource *mem;
        int error, irq;
@@ -380,7 +380,7 @@ err0:
 static inline void
 usb_hcd_da8xx_remove(struct usb_hcd *hcd, struct platform_device *pdev)
 {
-       struct da8xx_ohci_root_hub *hub = pdev->dev.platform_data;
+       struct da8xx_ohci_root_hub *hub = dev_get_platdata(&pdev->dev);
 
        hub->ocic_notify(NULL);
        usb_remove_hcd(hcd);
index b0b542c14e3132a9f35eceb86ef1255b676e13ca..dc6ee9adacf58679305df6baa851167e34e61ed4 100644 (file)
@@ -100,7 +100,7 @@ static const struct hc_driver exynos_ohci_hc_driver = {
 
 static int exynos_ohci_probe(struct platform_device *pdev)
 {
-       struct exynos4_ohci_platdata *pdata = pdev->dev.platform_data;
+       struct exynos4_ohci_platdata *pdata = dev_get_platdata(&pdev->dev);
        struct exynos_ohci_hcd *exynos_ohci;
        struct usb_hcd *hcd;
        struct ohci_hcd *ohci;
index 8747fa6a51b7cf1c067bf7cf8264c442a0e330db..31d3a12eb4867e56872f71cbea9f61ef1431dba5 100644 (file)
@@ -191,7 +191,7 @@ static void start_hnp(struct ohci_hcd *ohci)
 static int ohci_omap_init(struct usb_hcd *hcd)
 {
        struct ohci_hcd         *ohci = hcd_to_ohci(hcd);
-       struct omap_usb_config  *config = hcd->self.controller->platform_data;
+       struct omap_usb_config  *config = dev_get_platdata(hcd->self.controller);
        int                     need_transceiver = (config->otg != 0);
        int                     ret;
 
@@ -427,7 +427,7 @@ ohci_omap_start (struct usb_hcd *hcd)
 
        if (!host_enabled)
                return 0;
-       config = hcd->self.controller->platform_data;
+       config = dev_get_platdata(hcd->self.controller);
        if (config->otg || config->rwc) {
                ohci->hc_control = OHCI_CTRL_RWC;
                writel(OHCI_CTRL_RWC, &ohci->regs->control);
index bc30475c3a236886e3784d47ccfdaa4fbd5b7fb3..a4c6410f0ed494bfb6fb492849d1ed5f3b4fb1d2 100644 (file)
@@ -33,7 +33,7 @@ static const char hcd_name[] = "ohci-platform";
 static int ohci_platform_reset(struct usb_hcd *hcd)
 {
        struct platform_device *pdev = to_platform_device(hcd->self.controller);
-       struct usb_ohci_pdata *pdata = pdev->dev.platform_data;
+       struct usb_ohci_pdata *pdata = dev_get_platdata(&pdev->dev);
        struct ohci_hcd *ohci = hcd_to_ohci(hcd);
 
        if (pdata->big_endian_desc)
@@ -59,7 +59,7 @@ static int ohci_platform_probe(struct platform_device *dev)
 {
        struct usb_hcd *hcd;
        struct resource *res_mem;
-       struct usb_ohci_pdata *pdata = dev->dev.platform_data;
+       struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev);
        int irq;
        int err = -ENOMEM;
 
@@ -124,7 +124,7 @@ err_power:
 static int ohci_platform_remove(struct platform_device *dev)
 {
        struct usb_hcd *hcd = platform_get_drvdata(dev);
-       struct usb_ohci_pdata *pdata = dev->dev.platform_data;
+       struct usb_ohci_pdata *pdata = dev_get_platdata(&dev->dev);
 
        usb_remove_hcd(hcd);
        usb_put_hcd(hcd);
@@ -139,7 +139,7 @@ static int ohci_platform_remove(struct platform_device *dev)
 
 static int ohci_platform_suspend(struct device *dev)
 {
-       struct usb_ohci_pdata *pdata = dev->platform_data;
+       struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
        struct platform_device *pdev =
                container_of(dev, struct platform_device, dev);
 
@@ -152,7 +152,7 @@ static int ohci_platform_suspend(struct device *dev)
 static int ohci_platform_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
-       struct usb_ohci_pdata *pdata = dev->platform_data;
+       struct usb_ohci_pdata *pdata = dev_get_platdata(dev);
        struct platform_device *pdev =
                container_of(dev, struct platform_device, dev);
 
index 3a9c01d8b79c77b4fb607cbe003ab1b3ac6be6d5..93371a235e821fac080068f7522bc5a80576119c 100644 (file)
@@ -219,7 +219,7 @@ static int pxa27x_start_hc(struct pxa27x_ohci *ohci, struct device *dev)
        struct pxaohci_platform_data *inf;
        uint32_t uhchr;
 
-       inf = dev->platform_data;
+       inf = dev_get_platdata(dev);
 
        clk_prepare_enable(ohci->clk);
 
@@ -256,7 +256,7 @@ static void pxa27x_stop_hc(struct pxa27x_ohci *ohci, struct device *dev)
        struct pxaohci_platform_data *inf;
        uint32_t uhccoms;
 
-       inf = dev->platform_data;
+       inf = dev_get_platdata(dev);
 
        if (cpu_is_pxa3xx())
                pxa3xx_u2d_stop_hc(&ohci_to_hcd(&ohci->ohci)->self);
@@ -364,7 +364,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device
        if (retval)
                return retval;
 
-       inf = pdev->dev.platform_data;
+       inf = dev_get_platdata(&pdev->dev);
 
        if (!inf)
                return -ENODEV;
@@ -577,7 +577,7 @@ static int ohci_hcd_pxa27x_drv_resume(struct device *dev)
 {
        struct usb_hcd *hcd = dev_get_drvdata(dev);
        struct pxa27x_ohci *ohci = to_pxa27x_ohci(hcd);
-       struct pxaohci_platform_data *inf = dev->platform_data;
+       struct pxaohci_platform_data *inf = dev_get_platdata(dev);
        int status;
 
        if (time_before(jiffies, ohci->ohci.next_statechange))
index e125770b893c391ae59a6ab456f7ef80d19c32a9..4919afa4125e36eaeed297277da4631cb9cb5c7b 100644 (file)
@@ -38,12 +38,12 @@ static void s3c2410_hcd_oc(struct s3c2410_hcd_info *info, int port_oc);
 
 static struct s3c2410_hcd_info *to_s3c2410_info(struct usb_hcd *hcd)
 {
-       return hcd->self.controller->platform_data;
+       return dev_get_platdata(hcd->self.controller);
 }
 
 static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)
 {
-       struct s3c2410_hcd_info *info = dev->dev.platform_data;
+       struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev);
 
        dev_dbg(&dev->dev, "s3c2410_start_hc:\n");
 
@@ -63,7 +63,7 @@ static void s3c2410_start_hc(struct platform_device *dev, struct usb_hcd *hcd)
 
 static void s3c2410_stop_hc(struct platform_device *dev)
 {
-       struct s3c2410_hcd_info *info = dev->dev.platform_data;
+       struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev);
 
        dev_dbg(&dev->dev, "s3c2410_stop_hc:\n");
 
@@ -339,10 +339,11 @@ static int usb_hcd_s3c2410_probe(const struct hc_driver *driver,
                                  struct platform_device *dev)
 {
        struct usb_hcd *hcd = NULL;
+       struct s3c2410_hcd_info *info = dev_get_platdata(&dev->dev);
        int retval;
 
-       s3c2410_usb_set_power(dev->dev.platform_data, 1, 1);
-       s3c2410_usb_set_power(dev->dev.platform_data, 2, 1);
+       s3c2410_usb_set_power(info, 1, 1);
+       s3c2410_usb_set_power(info, 2, 1);
 
        hcd = usb_create_hcd(driver, &dev->dev, "s3c24xx");
        if (hcd == NULL)
index 197d514fe0d163741d6b6ac3fbb8fa62404c06c5..22540ab71f555dd9c60b461216cd46b2bbfb82ee 100644 (file)
@@ -95,7 +95,7 @@ static const struct hc_driver ohci_tilegx_hc_driver = {
 static int ohci_hcd_tilegx_drv_probe(struct platform_device *pdev)
 {
        struct usb_hcd *hcd;
-       struct tilegx_usb_platform_data *pdata = pdev->dev.platform_data;
+       struct tilegx_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
        pte_t pte = { 0 };
        int my_cpu = smp_processor_id();
        int ret;
@@ -175,7 +175,7 @@ err_hcd:
 static int ohci_hcd_tilegx_drv_remove(struct platform_device *pdev)
 {
        struct usb_hcd *hcd = platform_get_drvdata(pdev);
-       struct tilegx_usb_platform_data* pdata = pdev->dev.platform_data;
+       struct tilegx_usb_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
        usb_remove_hcd(hcd);
        usb_put_hcd(hcd);
index a6fd8f5371dfd9f7c534fbf73ff2cc815f1bbdb1..a9eef6822a24d8565f5b6b1f0bf71f59aaca2a92 100644 (file)
@@ -2467,7 +2467,7 @@ static int r8a66597_probe(struct platform_device *pdev)
        r8a66597 = hcd_to_r8a66597(hcd);
        memset(r8a66597, 0, sizeof(struct r8a66597));
        dev_set_drvdata(&pdev->dev, r8a66597);
-       r8a66597->pdata = pdev->dev.platform_data;
+       r8a66597->pdata = dev_get_platdata(&pdev->dev);
        r8a66597->irq_sense_low = irq_trigger == IRQF_TRIGGER_LOW;
 
        if (r8a66597->pdata->on_chip) {
index d8938630e092b14713ef631c72047c22c6a58446..5477bf5df2186549412612dc016e809fa6970124 100644 (file)
@@ -1691,7 +1691,7 @@ sl811h_probe(struct platform_device *dev)
 
        spin_lock_init(&sl811->lock);
        INIT_LIST_HEAD(&sl811->async);
-       sl811->board = dev->dev.platform_data;
+       sl811->board = dev_get_platdata(&dev->dev);
        init_timer(&sl811->timer);
        sl811->timer.function = sl811h_timer;
        sl811->timer.data = (unsigned long) sl811;
index 5c124bf5d01869c727543b34240deace3d27d1cd..e402beb5a06952e00948853a1845695fe2db69d3 100644 (file)
@@ -1809,9 +1809,9 @@ static int u132_hcd_start(struct usb_hcd *hcd)
                struct platform_device *pdev =
                        to_platform_device(hcd->self.controller);
                u16 vendor = ((struct u132_platform_data *)
-                       (pdev->dev.platform_data))->vendor;
+                       dev_get_platdata(&pdev->dev))->vendor;
                u16 device = ((struct u132_platform_data *)
-                       (pdev->dev.platform_data))->device;
+                       dev_get_platdata(&pdev->dev))->device;
                mutex_lock(&u132->sw_lock);
                msleep(10);
                if (vendor == PCI_VENDOR_ID_AMD && device == 0x740c) {
@@ -3034,7 +3034,7 @@ static void u132_initialise(struct u132 *u132, struct platform_device *pdev)
        int addrs = MAX_U132_ADDRS;
        int udevs = MAX_U132_UDEVS;
        int endps = MAX_U132_ENDPS;
-       u132->board = pdev->dev.platform_data;
+       u132->board = dev_get_platdata(&pdev->dev);
        u132->platform_dev = pdev;
        u132->power = 0;
        u132->reset = 0;