Commit c4c68d46 authored by Yangtao Li's avatar Yangtao Li Committed by Xu Yilun

fpga: fpga-mgr: socfpga: Convert to devm_platform_ioremap_resource()

Use devm_platform_ioremap_resource() to simplify code.
Signed-off-by: default avatarYangtao Li <frank.li@vivo.com>
Acked-by: default avatarXu Yilun <yilun.xu@intel.com>
Link: https://lore.kernel.org/r/20230705094655.44753-6-frank.li@vivo.comSigned-off-by: default avatarXu Yilun <yilun.xu@intel.com>
parent ebe00825
...@@ -545,20 +545,17 @@ static int socfpga_fpga_probe(struct platform_device *pdev) ...@@ -545,20 +545,17 @@ static int socfpga_fpga_probe(struct platform_device *pdev)
struct device *dev = &pdev->dev; struct device *dev = &pdev->dev;
struct socfpga_fpga_priv *priv; struct socfpga_fpga_priv *priv;
struct fpga_manager *mgr; struct fpga_manager *mgr;
struct resource *res;
int ret; int ret;
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
if (!priv) if (!priv)
return -ENOMEM; return -ENOMEM;
res = platform_get_resource(pdev, IORESOURCE_MEM, 0); priv->fpga_base_addr = devm_platform_ioremap_resource(pdev, 0);
priv->fpga_base_addr = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->fpga_base_addr)) if (IS_ERR(priv->fpga_base_addr))
return PTR_ERR(priv->fpga_base_addr); return PTR_ERR(priv->fpga_base_addr);
res = platform_get_resource(pdev, IORESOURCE_MEM, 1); priv->fpga_data_addr = devm_platform_ioremap_resource(pdev, 1);
priv->fpga_data_addr = devm_ioremap_resource(dev, res);
if (IS_ERR(priv->fpga_data_addr)) if (IS_ERR(priv->fpga_data_addr))
return PTR_ERR(priv->fpga_data_addr); return PTR_ERR(priv->fpga_data_addr);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment