Re: [PATCH 00/61] tree-wide: simplify getting .drvdata

From: Stephen Boyd
Date: Thu Apr 19 2018 - 18:23:54 EST


(Dropping the bazillion lists)

Quoting Wolfram Sang (2018-04-19 07:05:30)
>
> Here is the cocci-script I created (after <n> iterations by manually checking
> samples):
>
> @@
> struct device* d;
> identifier pdev;
> expression *ptr;
> @@
> (
> - struct platform_device *pdev = to_platform_device(d);
> |
> - struct platform_device *pdev;
> ...
> - pdev = to_platform_device(d);
> )
> <... when != pdev
> - &pdev->dev
> + d
> ...>
>
> ptr =
> - platform_get_drvdata(pdev)
> + dev_get_drvdata(d)
>
> <... when != pdev
> - &pdev->dev
> + d
> ...>
>

Can you throw this into scripts/coccinelle/ so we can have the build
testers run this all the time?