mirror of
https://github.com/torvalds/linux.git
synced 2024-11-22 20:22:09 +00:00
fpga: fpga-mgr: altera-pr-ip: 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/20230710133830.65631-1-frank.li@vivo.com Signed-off-by: Xu Yilun <yilun.xu@intel.com>
This commit is contained in:
parent
e9fdc41a3d
commit
c9b5ff3b9a
@ -15,13 +15,9 @@ static int alt_pr_platform_probe(struct platform_device *pdev)
|
|||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
void __iomem *reg_base;
|
void __iomem *reg_base;
|
||||||
struct resource *res;
|
|
||||||
|
|
||||||
/* First mmio base is for register access */
|
/* First mmio base is for register access */
|
||||||
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
reg_base = devm_platform_ioremap_resource(pdev, 0);
|
||||||
|
|
||||||
reg_base = devm_ioremap_resource(dev, res);
|
|
||||||
|
|
||||||
if (IS_ERR(reg_base))
|
if (IS_ERR(reg_base))
|
||||||
return PTR_ERR(reg_base);
|
return PTR_ERR(reg_base);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user