powerpc/fsl_rio: Use of_iomap()
Replace of_address_to_resource()+ioremap() with a call to of_iomap() which does both of those steps. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://msgid.link/20230327223103.820229-1-robh@kernel.org
This commit is contained in:
parent
037c47a436
commit
de8d11bc6e
@ -450,7 +450,6 @@ int fsl_rio_setup(struct platform_device *dev)
|
|||||||
int rc = 0;
|
int rc = 0;
|
||||||
const u32 *dt_range, *cell, *port_index;
|
const u32 *dt_range, *cell, *port_index;
|
||||||
u32 active_ports = 0;
|
u32 active_ports = 0;
|
||||||
struct resource regs, rmu_regs;
|
|
||||||
struct device_node *np, *rmu_node;
|
struct device_node *np, *rmu_node;
|
||||||
int rlen;
|
int rlen;
|
||||||
u32 ccsr;
|
u32 ccsr;
|
||||||
@ -465,17 +464,7 @@ int fsl_rio_setup(struct platform_device *dev)
|
|||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
rc = of_address_to_resource(dev->dev.of_node, 0, ®s);
|
rio_regs_win = of_iomap(dev->dev.of_node, 0);
|
||||||
if (rc) {
|
|
||||||
dev_err(&dev->dev, "Can't get %pOF property 'reg'\n",
|
|
||||||
dev->dev.of_node);
|
|
||||||
return -EFAULT;
|
|
||||||
}
|
|
||||||
dev_info(&dev->dev, "Of-device full name %pOF\n",
|
|
||||||
dev->dev.of_node);
|
|
||||||
dev_info(&dev->dev, "Regs: %pR\n", ®s);
|
|
||||||
|
|
||||||
rio_regs_win = ioremap(regs.start, resource_size(®s));
|
|
||||||
if (!rio_regs_win) {
|
if (!rio_regs_win) {
|
||||||
dev_err(&dev->dev, "Unable to map rio register window\n");
|
dev_err(&dev->dev, "Unable to map rio register window\n");
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
@ -509,15 +498,9 @@ int fsl_rio_setup(struct platform_device *dev)
|
|||||||
rc = -ENOENT;
|
rc = -ENOENT;
|
||||||
goto err_rmu;
|
goto err_rmu;
|
||||||
}
|
}
|
||||||
rc = of_address_to_resource(rmu_node, 0, &rmu_regs);
|
rmu_regs_win = of_iomap(rmu_node, 0);
|
||||||
if (rc) {
|
|
||||||
dev_err(&dev->dev, "Can't get %pOF property 'reg'\n",
|
|
||||||
rmu_node);
|
|
||||||
of_node_put(rmu_node);
|
|
||||||
goto err_rmu;
|
|
||||||
}
|
|
||||||
of_node_put(rmu_node);
|
of_node_put(rmu_node);
|
||||||
rmu_regs_win = ioremap(rmu_regs.start, resource_size(&rmu_regs));
|
|
||||||
if (!rmu_regs_win) {
|
if (!rmu_regs_win) {
|
||||||
dev_err(&dev->dev, "Unable to map rmu register window\n");
|
dev_err(&dev->dev, "Unable to map rmu register window\n");
|
||||||
rc = -ENOMEM;
|
rc = -ENOMEM;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user