linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/1] staging: media: imx: imx7-mipi-csis: simplify getting .driver_data
@ 2019-03-19 16:36 Wolfram Sang
  2019-03-20 14:40 ` Rui Miguel Silva
  2019-03-27 11:55 ` Simon Horman
  0 siblings, 2 replies; 3+ messages in thread
From: Wolfram Sang @ 2019-03-19 16:36 UTC (permalink / raw)
  To: linux-kernel
  Cc: linux-renesas-soc, Wolfram Sang, Rui Miguel Silva,
	Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	linux-media, devel, linux-arm-kernel

We should get 'driver_data' from 'struct device' directly. Going via
platform_device is an unneeded step back and forth.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Build tested only. buildbot is happy.

 drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
index 2ddcc42ab8ff..44569c63e4de 100644
--- a/drivers/staging/media/imx/imx7-mipi-csis.c
+++ b/drivers/staging/media/imx/imx7-mipi-csis.c
@@ -1039,8 +1039,7 @@ static int mipi_csis_probe(struct platform_device *pdev)
 
 static int mipi_csis_pm_suspend(struct device *dev, bool runtime)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev);
+	struct v4l2_subdev *mipi_sd = dev_get_drvdata(dev);
 	struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
 	int ret = 0;
 
@@ -1064,8 +1063,7 @@ static int mipi_csis_pm_suspend(struct device *dev, bool runtime)
 
 static int mipi_csis_pm_resume(struct device *dev, bool runtime)
 {
-	struct platform_device *pdev = to_platform_device(dev);
-	struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev);
+	struct v4l2_subdev *mipi_sd = dev_get_drvdata(dev);
 	struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
 	int ret = 0;
 
-- 
2.11.0


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

* Re: [PATCH 1/1] staging: media: imx: imx7-mipi-csis: simplify getting .driver_data
  2019-03-19 16:36 [PATCH 1/1] staging: media: imx: imx7-mipi-csis: simplify getting .driver_data Wolfram Sang
@ 2019-03-20 14:40 ` Rui Miguel Silva
  2019-03-27 11:55 ` Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Rui Miguel Silva @ 2019-03-20 14:40 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, linux-renesas-soc, Steve Longerbeam, Philipp Zabel,
	Mauro Carvalho Chehab, Greg Kroah-Hartman, Shawn Guo,
	Sascha Hauer, Pengutronix Kernel Team, Fabio Estevam,
	NXP Linux Team, linux-media, devel, linux-arm-kernel

Hi Wolfram,
Thanks for the patch.
On Tue 19 Mar 2019 at 16:36, Wolfram Sang wrote:
> We should get 'driver_data' from 'struct device' directly. Going 
> via
> platform_device is an unneeded step back and forth.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Rui Miguel Silva <rmfrfs@gmail.com>

---
Cheers,
	Rui

> ---
>
> Build tested only. buildbot is happy.
>
>  drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c 
> b/drivers/staging/media/imx/imx7-mipi-csis.c
> index 2ddcc42ab8ff..44569c63e4de 100644
> --- a/drivers/staging/media/imx/imx7-mipi-csis.c
> +++ b/drivers/staging/media/imx/imx7-mipi-csis.c
> @@ -1039,8 +1039,7 @@ static int mipi_csis_probe(struct 
> platform_device *pdev)
>  
>  static int mipi_csis_pm_suspend(struct device *dev, bool 
>  runtime)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev);
> +	struct v4l2_subdev *mipi_sd = dev_get_drvdata(dev);
>  	struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
>  	int ret = 0;
>  
> @@ -1064,8 +1063,7 @@ static int mipi_csis_pm_suspend(struct 
> device *dev, bool runtime)
>  
>  static int mipi_csis_pm_resume(struct device *dev, bool 
>  runtime)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev);
> +	struct v4l2_subdev *mipi_sd = dev_get_drvdata(dev);
>  	struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
>  	int ret = 0;


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

* Re: [PATCH 1/1] staging: media: imx: imx7-mipi-csis: simplify getting .driver_data
  2019-03-19 16:36 [PATCH 1/1] staging: media: imx: imx7-mipi-csis: simplify getting .driver_data Wolfram Sang
  2019-03-20 14:40 ` Rui Miguel Silva
@ 2019-03-27 11:55 ` Simon Horman
  1 sibling, 0 replies; 3+ messages in thread
From: Simon Horman @ 2019-03-27 11:55 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel, linux-renesas-soc, Rui Miguel Silva,
	Steve Longerbeam, Philipp Zabel, Mauro Carvalho Chehab,
	Greg Kroah-Hartman, Shawn Guo, Sascha Hauer,
	Pengutronix Kernel Team, Fabio Estevam, NXP Linux Team,
	linux-media, devel, linux-arm-kernel

On Tue, Mar 19, 2019 at 05:36:22PM +0100, Wolfram Sang wrote:
> We should get 'driver_data' from 'struct device' directly. Going via
> platform_device is an unneeded step back and forth.
> 
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Simon Horman <horms+renesas@verge.net.au>

> ---
> 
> Build tested only. buildbot is happy.
> 
>  drivers/staging/media/imx/imx7-mipi-csis.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/staging/media/imx/imx7-mipi-csis.c b/drivers/staging/media/imx/imx7-mipi-csis.c
> index 2ddcc42ab8ff..44569c63e4de 100644
> --- a/drivers/staging/media/imx/imx7-mipi-csis.c
> +++ b/drivers/staging/media/imx/imx7-mipi-csis.c
> @@ -1039,8 +1039,7 @@ static int mipi_csis_probe(struct platform_device *pdev)
>  
>  static int mipi_csis_pm_suspend(struct device *dev, bool runtime)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev);
> +	struct v4l2_subdev *mipi_sd = dev_get_drvdata(dev);
>  	struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
>  	int ret = 0;
>  
> @@ -1064,8 +1063,7 @@ static int mipi_csis_pm_suspend(struct device *dev, bool runtime)
>  
>  static int mipi_csis_pm_resume(struct device *dev, bool runtime)
>  {
> -	struct platform_device *pdev = to_platform_device(dev);
> -	struct v4l2_subdev *mipi_sd = platform_get_drvdata(pdev);
> +	struct v4l2_subdev *mipi_sd = dev_get_drvdata(dev);
>  	struct csi_state *state = mipi_sd_to_csis_state(mipi_sd);
>  	int ret = 0;
>  
> -- 
> 2.11.0
> 

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

end of thread, other threads:[~2019-03-27 11:55 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-19 16:36 [PATCH 1/1] staging: media: imx: imx7-mipi-csis: simplify getting .driver_data Wolfram Sang
2019-03-20 14:40 ` Rui Miguel Silva
2019-03-27 11:55 ` Simon Horman

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