On Wed, Jul 31, 2013 at 05:34:52PM +0400, Sergei Shtylyov wrote:
> Hello.
> 
> On 31-07-2013 10:22, Felipe Balbi wrote:
> 
> >Use the wrapper function for retrieving the
> >platform_data instead of accessing dev->platform_data
> >directly.
> 
> >Inspired-by: Jingoo Han  <jg1....@samsung.com>
> >Signed-off-by: Felipe Balbi <ba...@ti.com>
> >---
> >  drivers/usb/dwc3/core.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> >diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
> >index da0a4b8..aa48abd 100644
> >--- a/drivers/usb/dwc3/core.c
> >+++ b/drivers/usb/dwc3/core.c
> >@@ -350,11 +350,11 @@ static void dwc3_core_exit(struct dwc3 *dwc)
> >
> >  static int dwc3_probe(struct platform_device *pdev)
> >  {
> >-    struct dwc3_platform_data *pdata = pdev->dev.platform_data;
> >+    struct device           *dev = &pdev->dev;
> >+    struct dwc3_platform_data *pdata = dev_get_platdata(dev);
> >     struct device_node      *node = pdev->dev.of_node;
> 
>    Why not use your 'dev' variable also here?

where in the device node ? Uhm, because it's not part of $subject ? :-)

Anyway, it's so small change that I can do it in this commit and mention
about this change, here's the new version:

commit 941ea3616c747545d0278fc432fb7919b6d0d8f0
Author: Felipe Balbi <ba...@ti.com>
Date:   Wed Jul 31 09:21:25 2013 +0300

    usb: dwc3: use dev_get_platdata()
    
    Use the wrapper function for retrieving the
    platform_data instead of accessing dev->platform_data
    directly.
    
    While at that also make change 'node' initialization
    to use the dev pointer.
    
    Inspired-by: Jingoo Han  <jg1....@samsung.com>
    Signed-off-by: Felipe Balbi <ba...@ti.com>

diff --git a/drivers/usb/dwc3/core.c b/drivers/usb/dwc3/core.c
index da0a4b8..3ff6f0a 100644
--- a/drivers/usb/dwc3/core.c
+++ b/drivers/usb/dwc3/core.c
@@ -350,11 +350,11 @@ static void dwc3_core_exit(struct dwc3 *dwc)
 
 static int dwc3_probe(struct platform_device *pdev)
 {
-       struct dwc3_platform_data *pdata = pdev->dev.platform_data;
-       struct device_node      *node = pdev->dev.of_node;
+       struct device           *dev = &pdev->dev;
+       struct dwc3_platform_data *pdata = dev_get_platdata(dev);
+       struct device_node      *node = dev->of_node;
        struct resource         *res;
        struct dwc3             *dwc;
-       struct device           *dev = &pdev->dev;
 
        int                     ret = -ENOMEM;
 

-- 
balbi

Attachment: signature.asc
Description: Digital signature

Reply via email to