linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm/bridge/synopsys: dsi: Use devm_platform_ioremap_resource() in __dw_mipi_dsi_probe()
@ 2019-09-21 18:20 Markus Elfring
       [not found] ` <CGME20190923090614epcas5p215731e8359c634f7ed76759f68622e4f@epcas5p2.samsung.com>
  0 siblings, 1 reply; 2+ messages in thread
From: Markus Elfring @ 2019-09-21 18:20 UTC (permalink / raw)
  To: dri-devel, Andrzej Hajda, Daniel Vetter, David Airlie,
	Heiko Stübner, Jernej Skrabec, Jonas Karlman,
	Laurent Pinchart, Matt Redfearn, Neil Armstrong, Nickey Yang,
	Philippe Cornu, Sam Ravnborg, Yannick Fertré
  Cc: LKML, kernel-janitors

From: Markus Elfring <elfring@users.sourceforge.net>
Date: Sat, 21 Sep 2019 20:04:08 +0200

Simplify this function implementation by using a known wrapper function.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
---
 drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
index 675442bfc1bd..6ada149af9ef 100644
--- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
+++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
@@ -981,7 +981,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
 	struct device *dev = &pdev->dev;
 	struct reset_control *apb_rst;
 	struct dw_mipi_dsi *dsi;
-	struct resource *res;
 	int ret;

 	dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
@@ -997,11 +996,7 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
 	}

 	if (!plat_data->base) {
-		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-		if (!res)
-			return ERR_PTR(-ENODEV);
-
-		dsi->base = devm_ioremap_resource(dev, res);
+		dsi->base = devm_platform_ioremap_resource(pdev, 0);
 		if (IS_ERR(dsi->base))
 			return ERR_PTR(-ENODEV);

--
2.23.0


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

* Re: [PATCH] drm/bridge/synopsys: dsi: Use devm_platform_ioremap_resource() in __dw_mipi_dsi_probe()
       [not found]   ` <59343c81-3dd8-023c-6440-d48c8d74e05e@st.com>
@ 2019-09-25  8:09     ` Andrzej Hajda
  0 siblings, 0 replies; 2+ messages in thread
From: Andrzej Hajda @ 2019-09-25  8:09 UTC (permalink / raw)
  To: Yannick FERTRE, Markus Elfring, dri-devel, Daniel Vetter,
	David Airlie, Heiko Stübner, Jernej Skrabec, Jonas Karlman,
	Laurent Pinchart, Matt Redfearn, Neil Armstrong, Nickey Yang,
	Philippe CORNU, Sam Ravnborg
  Cc: LKML, kernel-janitors

Hi Yannick, Markus.

On 23.09.2019 11:05, Yannick FERTRE wrote:
> Reviewed-by: Yannick Fertré <yannick.fertre@st.com> 
> Tested-by: Yannick Fertré <yannick.fertre@st.com> 


Yannick, next time could you put your tags after tags of the patch,
otherwise patchwork is confused and creates incorrect patches [1].

[1]: https://patchwork.freedesktop.org/patch/332360/


> Best regards
>
> -- 
> Yannick Fertré | TINA: 166 7152 | Tel: +33 244027152 | Mobile: +33
> 620600270
> Microcontrollers and Digital ICs Group | Microcontrolleurs Division
>
>
> On 9/21/19 8:20 PM, Markus Elfring wrote:
>> From: Markus Elfring <elfring@users.sourceforge.net>
>> Date: Sat, 21 Sep 2019 20:04:08 +0200
>>
>> Simplify this function implementation by using a known wrapper function.
>>
>> This issue was detected by using the Coccinelle software.
>>
>> Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>


I meant here :)


Anyway, patch queued.


Regards

Andrzej



>> ---
>>  drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c | 7 +------
>>  1 file changed, 1 insertion(+), 6 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
>> index 675442bfc1bd..6ada149af9ef 100644
>> --- a/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
>> +++ b/drivers/gpu/drm/bridge/synopsys/dw-mipi-dsi.c
>> @@ -981,7 +981,6 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
>>  	struct device *dev = &pdev->dev;
>>  	struct reset_control *apb_rst;
>>  	struct dw_mipi_dsi *dsi;
>> -	struct resource *res;
>>  	int ret;
>>
>>  	dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
>> @@ -997,11 +996,7 @@ __dw_mipi_dsi_probe(struct platform_device *pdev,
>>  	}
>>
>>  	if (!plat_data->base) {
>> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>> -		if (!res)
>> -			return ERR_PTR(-ENODEV);
>> -
>> -		dsi->base = devm_ioremap_resource(dev, res);
>> +		dsi->base = devm_platform_ioremap_resource(pdev, 0);
>>  		if (IS_ERR(dsi->base))
>>  			return ERR_PTR(-ENODEV);
>>
>> --
>> 2.23.0
>>
>


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

end of thread, other threads:[~2019-09-25  8:09 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-21 18:20 [PATCH] drm/bridge/synopsys: dsi: Use devm_platform_ioremap_resource() in __dw_mipi_dsi_probe() Markus Elfring
     [not found] ` <CGME20190923090614epcas5p215731e8359c634f7ed76759f68622e4f@epcas5p2.samsung.com>
     [not found]   ` <59343c81-3dd8-023c-6440-d48c8d74e05e@st.com>
2019-09-25  8:09     ` Andrzej Hajda

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