mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 04:38:03 +00:00
fpga: fpga-mgr: socfpga: Convert to devm_platform_ioremap_resource()
Use devm_platform_ioremap_resource() to simplify code. Signed-off-by: Yangtao Li <frank.li@vivo.com> Acked-by: Xu Yilun <yilun.xu@intel.com> Link: https://lore.kernel.org/r/20230705094655.44753-6-frank.li@vivo.com Signed-off-by: Xu Yilun <yilun.xu@intel.com>
This commit is contained in:
parent
ebe00825f1
commit
c4c68d4697
@ -545,20 +545,17 @@ static int socfpga_fpga_probe(struct platform_device *pdev)
|
||||
struct device *dev = &pdev->dev;
|
||||
struct socfpga_fpga_priv *priv;
|
||||
struct fpga_manager *mgr;
|
||||
struct resource *res;
|
||||
int ret;
|
||||
|
||||
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
|
||||
if (!priv)
|
||||
return -ENOMEM;
|
||||
|
||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
||||
priv->fpga_base_addr = devm_ioremap_resource(dev, res);
|
||||
priv->fpga_base_addr = devm_platform_ioremap_resource(pdev, 0);
|
||||
if (IS_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_ioremap_resource(dev, res);
|
||||
priv->fpga_data_addr = devm_platform_ioremap_resource(pdev, 1);
|
||||
if (IS_ERR(priv->fpga_data_addr))
|
||||
return PTR_ERR(priv->fpga_data_addr);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user