linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] tree-wide: simplify getting .drvdata
@ 2018-04-22  9:14 Wolfram Sang
  2018-04-22  9:14 ` [PATCH 3/6] dmaengine: fsldma: " Wolfram Sang
  2018-04-22 16:11 ` [PATCH 0/6] tree-wide: " Vinod Koul
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2018-04-22  9:14 UTC (permalink / raw)
  To: dmaengine; +Cc: Wolfram Sang, linux-arm-kernel, linux-kernel, linuxppc-dev

I got tired of fixing this in Renesas drivers manually, so I took the big
hammer. Remove this cumbersome code pattern which got copy-pasted too much
already:

-	struct platform_device *pdev = to_platform_device(dev);
-	struct ep93xx_keypad *keypad = platform_get_drvdata(pdev);
+	struct ep93xx_keypad *keypad = dev_get_drvdata(dev);

I send this out as one patch per directory per subsystem. I think they should
be applied individually. If you prefer a broken out series per subsystem, I can
provide this as well. Just mail me.

A branch (tested by buildbot; only with all commits squashed into one commit
before) can be found here:

git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git coccinelle/get_drvdata

Open for other comments, suggestions, too, of course.

Here is the cocci-script I created:

@@
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
	...>

Kind regards,

   Wolfram


Wolfram Sang (6):
  dmaengine: at_hdmac: simplify getting .drvdata
  dmaengine: at_xdmac: simplify getting .drvdata
  dmaengine: fsldma: simplify getting .drvdata
  dmaengine: idma64: simplify getting .drvdata
  dmaengine: ste_dma40: simplify getting .drvdata
  dmaengine: txx9dmac: simplify getting .drvdata

 drivers/dma/at_hdmac.c  |  9 +++------
 drivers/dma/at_xdmac.c  |  9 +++------
 drivers/dma/fsldma.c    |  6 ++----
 drivers/dma/idma64.c    |  6 ++----
 drivers/dma/ste_dma40.c | 12 ++++--------
 drivers/dma/txx9dmac.c  |  8 +++-----
 6 files changed, 17 insertions(+), 33 deletions(-)

-- 
2.11.0

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-04-22 16:07 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-04-22  9:14 [PATCH 0/6] tree-wide: simplify getting .drvdata Wolfram Sang
2018-04-22  9:14 ` [PATCH 3/6] dmaengine: fsldma: " Wolfram Sang
2018-04-22 16:11 ` [PATCH 0/6] tree-wide: " Vinod Koul

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).