Commit 19f9e188deb4bbcd5fc588f39dc63bdfa9103827
Committed by
Felipe Balbi
1 parent
e01ee9f509
Exists in
master
and in
20 other branches
usb: phy: use dev_get_platdata()
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>
Showing 12 changed files with 22 additions and 20 deletions Side-by-side Diff
- 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
drivers/usb/phy/phy-fsl-usb.c
... | ... | @@ -834,7 +834,7 @@ |
834 | 834 | int status; |
835 | 835 | struct resource *res; |
836 | 836 | u32 temp; |
837 | - struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; | |
837 | + struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); | |
838 | 838 | |
839 | 839 | p_otg = container_of(otg_trans, struct fsl_otg, phy); |
840 | 840 | fsm = &p_otg->fsm; |
... | ... | @@ -1105,7 +1105,7 @@ |
1105 | 1105 | { |
1106 | 1106 | int ret; |
1107 | 1107 | |
1108 | - if (!pdev->dev.platform_data) | |
1108 | + if (!dev_get_platdata(&pdev->dev)) | |
1109 | 1109 | return -ENODEV; |
1110 | 1110 | |
1111 | 1111 | /* configure the OTG */ |
... | ... | @@ -1137,7 +1137,7 @@ |
1137 | 1137 | |
1138 | 1138 | static int fsl_otg_remove(struct platform_device *pdev) |
1139 | 1139 | { |
1140 | - struct fsl_usb2_platform_data *pdata = pdev->dev.platform_data; | |
1140 | + struct fsl_usb2_platform_data *pdata = dev_get_platdata(&pdev->dev); | |
1141 | 1141 | |
1142 | 1142 | usb_remove_phy(&fsl_otg_dev->phy); |
1143 | 1143 | free_irq(fsl_otg_dev->irq, fsl_otg_dev); |
drivers/usb/phy/phy-gpio-vbus-usb.c
... | ... | @@ -101,7 +101,7 @@ |
101 | 101 | { |
102 | 102 | struct gpio_vbus_data *gpio_vbus = |
103 | 103 | container_of(work, struct gpio_vbus_data, work.work); |
104 | - struct gpio_vbus_mach_info *pdata = gpio_vbus->dev->platform_data; | |
104 | + struct gpio_vbus_mach_info *pdata = dev_get_platdata(gpio_vbus->dev); | |
105 | 105 | int gpio, status, vbus; |
106 | 106 | |
107 | 107 | if (!gpio_vbus->phy.otg->gadget) |
... | ... | @@ -155,7 +155,7 @@ |
155 | 155 | static irqreturn_t gpio_vbus_irq(int irq, void *data) |
156 | 156 | { |
157 | 157 | struct platform_device *pdev = data; |
158 | - struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data; | |
158 | + struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev); | |
159 | 159 | struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev); |
160 | 160 | struct usb_otg *otg = gpio_vbus->phy.otg; |
161 | 161 | |
... | ... | @@ -182,7 +182,7 @@ |
182 | 182 | |
183 | 183 | gpio_vbus = container_of(otg->phy, struct gpio_vbus_data, phy); |
184 | 184 | pdev = to_platform_device(gpio_vbus->dev); |
185 | - pdata = gpio_vbus->dev->platform_data; | |
185 | + pdata = dev_get_platdata(gpio_vbus->dev); | |
186 | 186 | gpio = pdata->gpio_pullup; |
187 | 187 | |
188 | 188 | if (!gadget) { |
... | ... | @@ -243,7 +243,7 @@ |
243 | 243 | |
244 | 244 | static int __init gpio_vbus_probe(struct platform_device *pdev) |
245 | 245 | { |
246 | - struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data; | |
246 | + struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev); | |
247 | 247 | struct gpio_vbus_data *gpio_vbus; |
248 | 248 | struct resource *res; |
249 | 249 | int err, gpio, irq; |
... | ... | @@ -352,7 +352,7 @@ |
352 | 352 | static int __exit gpio_vbus_remove(struct platform_device *pdev) |
353 | 353 | { |
354 | 354 | struct gpio_vbus_data *gpio_vbus = platform_get_drvdata(pdev); |
355 | - struct gpio_vbus_mach_info *pdata = pdev->dev.platform_data; | |
355 | + struct gpio_vbus_mach_info *pdata = dev_get_platdata(&pdev->dev); | |
356 | 356 | int gpio = pdata->gpio_vbus; |
357 | 357 | |
358 | 358 | device_init_wakeup(&pdev->dev, 0); |
drivers/usb/phy/phy-msm-usb.c
... | ... | @@ -1419,7 +1419,7 @@ |
1419 | 1419 | struct usb_phy *phy; |
1420 | 1420 | |
1421 | 1421 | dev_info(&pdev->dev, "msm_otg probe\n"); |
1422 | - if (!pdev->dev.platform_data) { | |
1422 | + if (!dev_get_platdata(&pdev->dev)) { | |
1423 | 1423 | dev_err(&pdev->dev, "No platform data given. Bailing out\n"); |
1424 | 1424 | return -ENODEV; |
1425 | 1425 | } |
... | ... | @@ -1436,7 +1436,7 @@ |
1436 | 1436 | return -ENOMEM; |
1437 | 1437 | } |
1438 | 1438 | |
1439 | - motg->pdata = pdev->dev.platform_data; | |
1439 | + motg->pdata = dev_get_platdata(&pdev->dev); | |
1440 | 1440 | phy = &motg->phy; |
1441 | 1441 | phy->dev = &pdev->dev; |
1442 | 1442 |
drivers/usb/phy/phy-mv-u3d-usb.c
drivers/usb/phy/phy-mv-usb.c
... | ... | @@ -673,7 +673,7 @@ |
673 | 673 | |
674 | 674 | static int mv_otg_probe(struct platform_device *pdev) |
675 | 675 | { |
676 | - struct mv_usb_platform_data *pdata = pdev->dev.platform_data; | |
676 | + struct mv_usb_platform_data *pdata = dev_get_platdata(&pdev->dev); | |
677 | 677 | struct mv_otg *mvotg; |
678 | 678 | struct usb_otg *otg; |
679 | 679 | struct resource *r; |
drivers/usb/phy/phy-nop.c
... | ... | @@ -142,7 +142,8 @@ |
142 | 142 | static int nop_usb_xceiv_probe(struct platform_device *pdev) |
143 | 143 | { |
144 | 144 | struct device *dev = &pdev->dev; |
145 | - struct nop_usb_xceiv_platform_data *pdata = pdev->dev.platform_data; | |
145 | + struct nop_usb_xceiv_platform_data *pdata = | |
146 | + dev_get_platdata(&pdev->dev); | |
146 | 147 | struct nop_usb_xceiv *nop; |
147 | 148 | enum usb_phy_type type = USB_PHY_TYPE_USB2; |
148 | 149 | int err; |
drivers/usb/phy/phy-omap-control.c
... | ... | @@ -197,7 +197,8 @@ |
197 | 197 | { |
198 | 198 | struct resource *res; |
199 | 199 | struct device_node *np = pdev->dev.of_node; |
200 | - struct omap_control_usb_platform_data *pdata = pdev->dev.platform_data; | |
200 | + struct omap_control_usb_platform_data *pdata = | |
201 | + dev_get_platdata(&pdev->dev); | |
201 | 202 | |
202 | 203 | control_usb = devm_kzalloc(&pdev->dev, sizeof(*control_usb), |
203 | 204 | GFP_KERNEL); |
drivers/usb/phy/phy-rcar-usb.c
... | ... | @@ -83,7 +83,7 @@ |
83 | 83 | { |
84 | 84 | struct rcar_usb_phy_priv *priv = usb_phy_to_priv(phy); |
85 | 85 | struct device *dev = phy->dev; |
86 | - struct rcar_phy_platform_data *pdata = dev->platform_data; | |
86 | + struct rcar_phy_platform_data *pdata = dev_get_platdata(dev); | |
87 | 87 | void __iomem *reg0 = priv->reg0; |
88 | 88 | void __iomem *reg1 = priv->reg1; |
89 | 89 | static const u8 ovcn_act[] = { OVC0_ACT, OVC1_ACT, OVC2_ACT }; |
... | ... | @@ -184,7 +184,7 @@ |
184 | 184 | void __iomem *reg0, *reg1 = NULL; |
185 | 185 | int ret; |
186 | 186 | |
187 | - if (!pdev->dev.platform_data) { | |
187 | + if (!dev_get_platdata(&pdev->dev)) { | |
188 | 188 | dev_err(dev, "No platform data\n"); |
189 | 189 | return -EINVAL; |
190 | 190 | } |
drivers/usb/phy/phy-samsung-usb2.c
... | ... | @@ -359,7 +359,7 @@ |
359 | 359 | { |
360 | 360 | struct samsung_usbphy *sphy; |
361 | 361 | struct usb_otg *otg; |
362 | - struct samsung_usbphy_data *pdata = pdev->dev.platform_data; | |
362 | + struct samsung_usbphy_data *pdata = dev_get_platdata(&pdev->dev); | |
363 | 363 | const struct samsung_usbphy_drvdata *drv_data; |
364 | 364 | struct device *dev = &pdev->dev; |
365 | 365 | struct resource *phy_mem; |
drivers/usb/phy/phy-samsung-usb3.c
... | ... | @@ -231,7 +231,7 @@ |
231 | 231 | static int samsung_usb3phy_probe(struct platform_device *pdev) |
232 | 232 | { |
233 | 233 | struct samsung_usbphy *sphy; |
234 | - struct samsung_usbphy_data *pdata = pdev->dev.platform_data; | |
234 | + struct samsung_usbphy_data *pdata = dev_get_platdata(&pdev->dev); | |
235 | 235 | struct device *dev = &pdev->dev; |
236 | 236 | struct resource *phy_mem; |
237 | 237 | void __iomem *phy_base; |
drivers/usb/phy/phy-twl4030-usb.c
... | ... | @@ -648,7 +648,7 @@ |
648 | 648 | |
649 | 649 | static int twl4030_usb_probe(struct platform_device *pdev) |
650 | 650 | { |
651 | - struct twl4030_usb_data *pdata = pdev->dev.platform_data; | |
651 | + struct twl4030_usb_data *pdata = dev_get_platdata(&pdev->dev); | |
652 | 652 | struct twl4030_usb *twl; |
653 | 653 | int status, err; |
654 | 654 | struct usb_otg *otg; |
drivers/usb/phy/phy-twl6030-usb.c
... | ... | @@ -324,7 +324,7 @@ |
324 | 324 | int status, err; |
325 | 325 | struct device_node *np = pdev->dev.of_node; |
326 | 326 | struct device *dev = &pdev->dev; |
327 | - struct twl4030_usb_data *pdata = dev->platform_data; | |
327 | + struct twl4030_usb_data *pdata = dev_get_platdata(dev); | |
328 | 328 | |
329 | 329 | twl = devm_kzalloc(dev, sizeof *twl, GFP_KERNEL); |
330 | 330 | if (!twl) |