]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
usb: phy: use dev_get_platdata()
authorJingoo Han <jg1.han@samsung.com>
Tue, 30 Jul 2013 08:02:13 +0000 (17:02 +0900)
committerFelipe Balbi <balbi@ti.com>
Tue, 30 Jul 2013 08:18:53 +0000 (11:18 +0300)
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: Felipe Balbi <balbi@ti.com>
12 files changed:
drivers/usb/phy/phy-fsl-usb.c
drivers/usb/phy/phy-gpio-vbus-usb.c
drivers/usb/phy/phy-msm-usb.c
drivers/usb/phy/phy-mv-u3d-usb.c
drivers/usb/phy/phy-mv-usb.c
drivers/usb/phy/phy-nop.c
drivers/usb/phy/phy-omap-control.c
drivers/usb/phy/phy-rcar-usb.c
drivers/usb/phy/phy-samsung-usb2.c
drivers/usb/phy/phy-samsung-usb3.c
drivers/usb/phy/phy-twl4030-usb.c
drivers/usb/phy/phy-twl6030-usb.c

index e771bafb9f1da3375f9f0492493c973fe0862484..e965cf65d696716a5c9f914598496fb2c6379431 100644 (file)
@@ -834,7 +834,7 @@ int usb_otg_start(struct platform_device *pdev)
        int status;
        struct resource *res;
        u32 temp;
-       struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data;
+       struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev);
 
        p_otg = container_of(otg_trans, struct fsl_otg, phy);
        fsm = &p_otg->fsm;
@@ -1105,7 +1105,7 @@ static int fsl_otg_probe(struct platform_device *pdev)
 {
        int ret;
 
-       if (!pdev->dev.platform_data)
+       if (!dev_get_platdata(&pdev->dev))
                return -ENODEV;
 
        /* configure the OTG */
@@ -1137,7 +1137,7 @@ static int fsl_otg_probe(struct platform_device *pdev)
 
 static int fsl_otg_remove(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);
 
        usb_remove_phy(&fsl_otg_dev->phy);
        free_irq(fsl_otg_dev->irq, fsl_otg_dev);
index 8443335c2ea0260414ea183fe69c809b5b328d64..b2f29c9aebbfdb15e9e9be8004f2e8d7bf5ed60d 100644 (file)
@@ -101,7 +101,7 @@ static void gpio_vbus_work(struct work_struct *work)
 {
        struct gpio_vbus_data *gpio_vbus =
                container_of(work, struct gpio_vbus_data, work.work);
-       struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data;
+       struct gpio_vbus_mach_info *pdata = dev_get_platdata(gpio_vbus->dev);
        int gpio, status, vbus;
 
        if (!gpio_vbus->phy.otg->gadget)
@@ -155,7 +155,7 @@ static void gpio_vbus_work(struct work_struct *work)
 static irqreturn_t gpio_vbus_irq(int irq, void *data)
 {
        struct platform_device *pdev = data;
-       struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data;
+       struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
        struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
        struct usb_otg *otg = gpio_vbus->phy.otg;
 
@@ -182,7 +182,7 @@ static int gpio_vbus_set_peripheral(struct usb_otg *otg,
 
        gpio_vbus = container_of(otg->phy, struct gpio_vbus_data, phy);
        pdev = to_platform_device(gpio_vbus->dev);
-       pdata = gpio_vbus->dev->platform_data;
+       pdata = dev_get_platdata(gpio_vbus->dev);
        gpio = pdata->gpio_pullup;
 
        if (!gadget) {
@@ -243,7 +243,7 @@ static int gpio_vbus_set_suspend(struct usb_phy *phy, int suspend)
 
 static int __init gpio_vbus_probe(struct platform_device *pdev)
 {
-       struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data;
+       struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
        struct gpio_vbus_data *gpio_vbus;
        struct resource *res;
        int err, gpio, irq;
@@ -352,7 +352,7 @@ err_gpio:
 static int __exit gpio_vbus_remove(struct platform_device *pdev)
 {
        struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev);
-       struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data;
+       struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev);
        int gpio = pdata->gpio_vbus;
 
        device_init_wakeup(&pdev->dev, 0);
index d08f33435e96e67f9b61389e176f624d64a2f95d..e9d4cd960ecdee0c1363066d8ebac955a7f7266a 100644 (file)
@@ -1419,7 +1419,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
        struct usb_phy *phy;
 
        dev_info(&pdev->dev, "msm_otg probe\n");
-       if (!pdev->dev.platform_data) {
+       if (!dev_get_platdata(&pdev->dev)) {
                dev_err(&pdev->dev, "No platform data given. Bailing out\n");
                return -ENODEV;
        }
@@ -1436,7 +1436,7 @@ static int __init msm_otg_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
 
-       motg->pdata = pdev->dev.platform_data;
+       motg->pdata = dev_get_platdata(&pdev->dev);
        phy = &motg->phy;
        phy->dev = &pdev->dev;
 
index 1568ea63e3380766be04a0491f891e5471bf9ba9..6688023021d3a2be6671260b074ed279026ba702 100644 (file)
@@ -271,7 +271,7 @@ static int mv_u3d_phy_probe(struct platform_device *pdev)
        void __iomem    *phy_base;
        int     ret;
 
-       pdata = pdev->dev.platform_data;
+       pdata = dev_get_platdata(&pdev->dev);
        if (!pdata) {
                dev_err(&pdev->dev, "%s: no platform data defined\n", __func__);
                return -EINVAL;
index 4a6b03c738765814adc2eefe6bbbdef6eba8bf0b..03d16ff24c02bbc3391604ec1f798594b48848ac 100644 (file)
@@ -673,7 +673,7 @@ int mv_otg_remove(struct platform_device *pdev)
 
 static int mv_otg_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 mv_otg *mvotg;
        struct usb_otg *otg;
        struct resource *r;
index 55445e5d72e597c4476ff62d0c471ce3fb9433a3..f52b7f89eef1eeabf303333db2b8127d06f9d4c1 100644 (file)
@@ -142,7 +142,8 @@ static int nop_set_host(struct usb_otg *otg, struct usb_bus *host)
 static int nop_usb_xceiv_probe(struct platform_device *pdev)
 {
        struct device *dev = &pdev->dev;
-       struct nop_usb_xceiv_platform_data *pdata = pdev->dev.platform_data;
+       struct nop_usb_xceiv_platform_data *pdata =
+                       dev_get_platdata(&pdev->dev);
        struct nop_usb_xceiv    *nop;
        enum usb_phy_type       type = USB_PHY_TYPE_USB2;
        int err;
index 1419ceda9759c591f5036dddda8c5c673a2d7fa4..a4dda8e1256257104cdfdd3d54707af57361ed8f 100644 (file)
@@ -197,7 +197,8 @@ static int omap_control_usb_probe(struct platform_device *pdev)
 {
        struct resource *res;
        struct device_node *np = pdev->dev.of_node;
-       struct omap_control_usb_platform_data *pdata = pdev->dev.platform_data;
+       struct omap_control_usb_platform_data *pdata =
+                       dev_get_platdata(&pdev->dev);
 
        control_usb = devm_kzalloc(&pdev->dev, sizeof(*control_usb),
                GFP_KERNEL);
index deb7f97f37c7942365b12a251a44361ba4dff6ac..33265a5b2cdf8fdca0fc6ba0b7752a6a54ae9c4f 100644 (file)
@@ -83,7 +83,7 @@ static int rcar_usb_phy_init(struct usb_phy *phy)
 {
        struct rcar_usb_phy_priv *priv = usb_phy_to_priv(phy);
        struct device *dev = phy->dev;
-       struct rcar_phy_platform_data *pdata = dev->platform_data;
+       struct rcar_phy_platform_data *pdata = dev_get_platdata(dev);
        void __iomem *reg0 = priv->reg0;
        void __iomem *reg1 = priv->reg1;
        static const u8 ovcn_act[] = { OVC0_ACT, OVC1_ACT, OVC2_ACT };
@@ -184,7 +184,7 @@ static int rcar_usb_phy_probe(struct platform_device *pdev)
        void __iomem *reg0, *reg1 = NULL;
        int ret;
 
-       if (!pdev->dev.platform_data) {
+       if (!dev_get_platdata(&pdev->dev)) {
                dev_err(dev, "No platform data\n");
                return -EINVAL;
        }
index 758b86d0fcb386af39561d2d25e8ad9983c97fbf..ff70e4b19b9705cc4b69b1ea0de7b5c1ecf23959 100644 (file)
@@ -359,7 +359,7 @@ static int samsung_usb2phy_probe(struct platform_device *pdev)
 {
        struct samsung_usbphy *sphy;
        struct usb_otg *otg;
-       struct samsung_usbphy_data *pdata = pdev->dev.platform_data;
+       struct samsung_usbphy_data *pdata = dev_get_platdata(&pdev->dev);
        const struct samsung_usbphy_drvdata *drv_data;
        struct device *dev = &pdev->dev;
        struct resource *phy_mem;
index 300e0cf5e31f4fdb7ada4034237750293335589d..c6eb22213de607c3a5997b7a80a92d814eb371bd 100644 (file)
@@ -231,7 +231,7 @@ static void samsung_usb3phy_shutdown(struct usb_phy *phy)
 static int samsung_usb3phy_probe(struct platform_device *pdev)
 {
        struct samsung_usbphy *sphy;
-       struct samsung_usbphy_data *pdata = pdev->dev.platform_data;
+       struct samsung_usbphy_data *pdata = dev_get_platdata(&pdev->dev);
        struct device *dev = &pdev->dev;
        struct resource *phy_mem;
        void __iomem    *phy_base;
index 8f78d2d40722ebb2412415a33d369666a3c9167a..90730c8762b8f8ee850a8a153ad757a4b5b3337e 100644 (file)
@@ -648,7 +648,7 @@ static int twl4030_set_host(struct usb_otg *otg, struct usb_bus *host)
 
 static int twl4030_usb_probe(struct platform_device *pdev)
 {
-       struct twl4030_usb_data *pdata = pdev->dev.platform_data;
+       struct twl4030_usb_data *pdata = dev_get_platdata(&pdev->dev);
        struct twl4030_usb      *twl;
        int                     status, err;
        struct usb_otg          *otg;
index 1753bd367e0ab7aa36b433fc3d77cac2a5b6b9e2..16dbc93826789dc22d0a2d955bc4c880cf9196c5 100644 (file)
@@ -324,7 +324,7 @@ static int twl6030_usb_probe(struct platform_device *pdev)
        int                     status, err;
        struct device_node      *np = pdev->dev.of_node;
        struct device           *dev = &pdev->dev;
-       struct twl4030_usb_data *pdata = dev->platform_data;
+       struct twl4030_usb_data *pdata = dev_get_platdata(dev);
 
        twl = devm_kzalloc(dev, sizeof *twl, GFP_KERNEL);
        if (!twl)