diff mbox series

[3/5] EDAC/synopsys: Convert to devm_platform_ioremap_resource()

Message ID 20230704101811.49637-3-frank.li@vivo.com (mailing list archive)
State New, archived
Headers show
Series [1/5] EDAC, mellanox: Convert to devm_platform_ioremap_resource() | expand

Commit Message

Yangtao Li July 4, 2023, 10:18 a.m. UTC
Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/edac/synopsys_edac.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

Comments

Michal Simek July 4, 2023, 12:17 p.m. UTC | #1
On 7/4/23 12:18, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@vivo.com>
> ---
>   drivers/edac/synopsys_edac.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
> index f7d37c282819..620861fb5231 100644
> --- a/drivers/edac/synopsys_edac.c
> +++ b/drivers/edac/synopsys_edac.c
> @@ -1325,11 +1325,9 @@ static int mc_probe(struct platform_device *pdev)
>   	struct synps_edac_priv *priv;
>   	struct mem_ctl_info *mci;
>   	void __iomem *baseaddr;
> -	struct resource *res;
>   	int rc;
>   
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	baseaddr = devm_ioremap_resource(&pdev->dev, res);
> +	baseaddr = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(baseaddr))
>   		return PTR_ERR(baseaddr);
>   

Reviewed-by: Michal Simek <michal.simek@amd.com>

Thanks,
Michal
Borislav Petkov Jan. 23, 2024, 1:57 p.m. UTC | #2
On Tue, Jul 04, 2023 at 02:17:09PM +0200, Michal Simek wrote:
> On 7/4/23 12:18, Yangtao Li wrote:
> > Use devm_platform_ioremap_resource() to simplify code.
> > 
> > Signed-off-by: Yangtao Li <frank.li@vivo.com>
> > ---
> >   drivers/edac/synopsys_edac.c | 4 +---
> >   1 file changed, 1 insertion(+), 3 deletions(-)
> > 
> > diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
> > index f7d37c282819..620861fb5231 100644
> > --- a/drivers/edac/synopsys_edac.c
> > +++ b/drivers/edac/synopsys_edac.c
> > @@ -1325,11 +1325,9 @@ static int mc_probe(struct platform_device *pdev)
> >   	struct synps_edac_priv *priv;
> >   	struct mem_ctl_info *mci;
> >   	void __iomem *baseaddr;
> > -	struct resource *res;
> >   	int rc;
> > -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > -	baseaddr = devm_ioremap_resource(&pdev->dev, res);
> > +	baseaddr = devm_platform_ioremap_resource(pdev, 0);
> >   	if (IS_ERR(baseaddr))
> >   		return PTR_ERR(baseaddr);
> 
> Reviewed-by: Michal Simek <michal.simek@amd.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/drivers/edac/synopsys_edac.c b/drivers/edac/synopsys_edac.c
index f7d37c282819..620861fb5231 100644
--- a/drivers/edac/synopsys_edac.c
+++ b/drivers/edac/synopsys_edac.c
@@ -1325,11 +1325,9 @@  static int mc_probe(struct platform_device *pdev)
 	struct synps_edac_priv *priv;
 	struct mem_ctl_info *mci;
 	void __iomem *baseaddr;
-	struct resource *res;
 	int rc;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	baseaddr = devm_ioremap_resource(&pdev->dev, res);
+	baseaddr = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(baseaddr))
 		return PTR_ERR(baseaddr);