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

Message ID 20230707024224.78907-2-frank.li@vivo.com
State New
Headers
Series [1/3] misc: atmel-ssc: Use devm_platform_get_and_ioremap_resource() |

Commit Message

李扬韬 July 7, 2023, 2:42 a.m. UTC
  Use devm_platform_ioremap_resource() to simplify code.

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

Comments

Michal Simek July 7, 2023, 6:21 a.m. UTC | #1
On 7/7/23 04:42, Yangtao Li wrote:
> Use devm_platform_ioremap_resource() to simplify code.
> 
> Signed-off-by: Yangtao Li <frank.li@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@amd.com>

Thanks,
M
  

Patch

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;