mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH -next] drm/stm: dsi: Use devm_platform_ioremap_resource()
@ 2023-04-21  8:34 Yang Li
  2023-04-25  8:26 ` Raphael Gallais-Pou
  2023-05-26 11:36 ` Philippe CORNU
  0 siblings, 2 replies; 3+ messages in thread
From: Yang Li @ 2023-04-21  8:34 UTC (permalink / raw)
  To: yannick.fertre
  Cc: raphael.gallais-pou, philippe.cornu, airlied, daniel,
	mcoquelin.stm32, alexandre.torgue, dri-devel, linux-stm32,
	linux-arm-kernel, linux-kernel, Yang Li

Convert platform_get_resource(),devm_ioremap_resource() to a single call
to devm_platform_ioremap_resource(), as this is exactly what this function
does.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
---
 drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
index 89897d5f5c72..1750b6a25e87 100644
--- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
+++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
@@ -444,15 +444,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct dw_mipi_dsi_stm *dsi;
 	struct clk *pclk;
-	struct resource *res;
 	int ret;
 
 	dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
 	if (!dsi)
 		return -ENOMEM;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	dsi->base = devm_ioremap_resource(dev, res);
+	dsi->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(dsi->base)) {
 		ret = PTR_ERR(dsi->base);
 		DRM_ERROR("Unable to get dsi registers %d\n", ret);
-- 
2.20.1.7.g153144c


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

* Re: [PATCH -next] drm/stm: dsi: Use devm_platform_ioremap_resource()
  2023-04-21  8:34 [PATCH -next] drm/stm: dsi: Use devm_platform_ioremap_resource() Yang Li
@ 2023-04-25  8:26 ` Raphael Gallais-Pou
  2023-05-26 11:36 ` Philippe CORNU
  1 sibling, 0 replies; 3+ messages in thread
From: Raphael Gallais-Pou @ 2023-04-25  8:26 UTC (permalink / raw)
  To: Yang Li, yannick.fertre
  Cc: philippe.cornu, airlied, daniel, mcoquelin.stm32,
	alexandre.torgue, dri-devel, linux-stm32, linux-arm-kernel,
	linux-kernel

Hi Yang,

On 4/21/23 10:34, Yang Li wrote:
> Convert platform_get_resource(),devm_ioremap_resource() to a single call
> to devm_platform_ioremap_resource(), as this is exactly what this function
> does.
>
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>  drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> index 89897d5f5c72..1750b6a25e87 100644
> --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> @@ -444,15 +444,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>  	struct device *dev = &pdev->dev;
>  	struct dw_mipi_dsi_stm *dsi;
>  	struct clk *pclk;
> -	struct resource *res;
>  	int ret;
>  
>  	dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
>  	if (!dsi)
>  		return -ENOMEM;
>  
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	dsi->base = devm_ioremap_resource(dev, res);
> +	dsi->base = devm_platform_ioremap_resource(pdev, 0);
>  	if (IS_ERR(dsi->base)) {
>  		ret = PTR_ERR(dsi->base);
>  		DRM_ERROR("Unable to get dsi registers %d\n", ret);


Thanks for the patch.

Acked-by: Raphael Gallais-Pou <raphael.gallais-pou@foss.st.com>


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

* Re: [PATCH -next] drm/stm: dsi: Use devm_platform_ioremap_resource()
  2023-04-21  8:34 [PATCH -next] drm/stm: dsi: Use devm_platform_ioremap_resource() Yang Li
  2023-04-25  8:26 ` Raphael Gallais-Pou
@ 2023-05-26 11:36 ` Philippe CORNU
  1 sibling, 0 replies; 3+ messages in thread
From: Philippe CORNU @ 2023-05-26 11:36 UTC (permalink / raw)
  To: Yang Li, yannick.fertre
  Cc: raphael.gallais-pou, airlied, daniel, mcoquelin.stm32,
	alexandre.torgue, dri-devel, linux-stm32, linux-arm-kernel,
	linux-kernel


On 4/21/23 10:34, Yang Li wrote:
> Convert platform_get_resource(),devm_ioremap_resource() to a single call
> to devm_platform_ioremap_resource(), as this is exactly what this function
> does.
> 
> Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
> ---
>   drivers/gpu/drm/stm/dw_mipi_dsi-stm.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> index 89897d5f5c72..1750b6a25e87 100644
> --- a/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> +++ b/drivers/gpu/drm/stm/dw_mipi_dsi-stm.c
> @@ -444,15 +444,13 @@ static int dw_mipi_dsi_stm_probe(struct platform_device *pdev)
>   	struct device *dev = &pdev->dev;
>   	struct dw_mipi_dsi_stm *dsi;
>   	struct clk *pclk;
> -	struct resource *res;
>   	int ret;
>   
>   	dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL);
>   	if (!dsi)
>   		return -ENOMEM;
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	dsi->base = devm_ioremap_resource(dev, res);
> +	dsi->base = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(dsi->base)) {
>   		ret = PTR_ERR(dsi->base);
>   		DRM_ERROR("Unable to get dsi registers %d\n", ret);

Applied on drm-misc-next.
Many thanks for your patch,
Philippe :-)

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

end of thread, other threads:[~2023-05-26 11:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-21  8:34 [PATCH -next] drm/stm: dsi: Use devm_platform_ioremap_resource() Yang Li
2023-04-25  8:26 ` Raphael Gallais-Pou
2023-05-26 11:36 ` Philippe CORNU

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®