[PATCH] USB: isp1362: Add devicetree support
    Mike Frysinger 
    vapier at gentoo.org
       
    Sat Aug  6 19:47:10 EST 2011
    
    
  
On Tue, Aug 2, 2011 at 06:49, Tobias Klauser wrote:
> @@ -2755,12 +2805,31 @@ static int __devinit 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;
> +
> +       pdata = pdev->dev.platform_data;
> +
> +       /* If no platform data is available, try to get it from device tree */
> +       if (!pdata) {
> +               pdata = kzalloc(sizeof(struct isp1362_platform_data), GFP_KERNEL);
sizeof(*pdata)
the rest of the non-of code looks fine to me.  as for of, i havent
used it before, so i have no feedback on it as long as it's behind
CONFIG_OF (which it is).
Acked-by: Mike Frysinger <vapier at gentoo.org>
-mike
    
    
More information about the devicetree-discuss
mailing list