[PATCH 2/3] misc/xilinx_sdfec: Convert to devm_platform_ioremap_resource()

Michal Simek michal.simek at amd.com
Thu Jul 6 23:21:32 PDT 2023



On 7/7/23 04:42, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li at vivo.com>
> ---
>   drivers/misc/xilinx_sdfec.c | 4 +---
>   1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/misc/xilinx_sdfec.c b/drivers/misc/xilinx_sdfec.c
> index 270ff4c5971a..0877c42fb8e7 100644
> --- a/drivers/misc/xilinx_sdfec.c
> +++ b/drivers/misc/xilinx_sdfec.c
> @@ -1347,7 +1347,6 @@ static int xsdfec_probe(struct platform_device *pdev)
>   {
>   	struct xsdfec_dev *xsdfec;
>   	struct device *dev;
> -	struct resource *res;
>   	int err;
>   	bool irq_enabled = true;
>   
> @@ -1363,8 +1362,7 @@ static int xsdfec_probe(struct platform_device *pdev)
>   		return err;
>   
>   	dev = xsdfec->dev;
> -	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -	xsdfec->regs = devm_ioremap_resource(dev, res);
> +	xsdfec->regs = devm_platform_ioremap_resource(pdev, 0);
>   	if (IS_ERR(xsdfec->regs)) {
>   		err = PTR_ERR(xsdfec->regs);
>   		goto err_xsdfec_dev;

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

Thanks,
M



More information about the linux-arm-kernel mailing list