bus: uniphier-system-bus: use devm_platform_ioremap_resource()
Replace the chain of platform_get_resource() and devm_ioremap_resource() with devm_platform_ioremap_resource(). This allows to remove the local variable for (struct resource *), and have one function call less. Link: https://lore.kernel.org/r/20190905032122.26076-1-yamada.masahiro@socionext.com Signed-off-by: Masahiro Yamada <yamada.masahiro@socionext.com> Signed-off-by: Arnd Bergmann <arnd@arndb.de>alistair/sunxi64-5.4-dsi
parent
b8580b2831
commit
ef92bfdaa7
|
@ -176,7 +176,6 @@ static int uniphier_system_bus_probe(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
struct device *dev = &pdev->dev;
|
struct device *dev = &pdev->dev;
|
||||||
struct uniphier_system_bus_priv *priv;
|
struct uniphier_system_bus_priv *priv;
|
||||||
struct resource *regs;
|
|
||||||
const __be32 *ranges;
|
const __be32 *ranges;
|
||||||
u32 cells, addr, size;
|
u32 cells, addr, size;
|
||||||
u64 paddr;
|
u64 paddr;
|
||||||
|
@ -186,8 +185,7 @@ static int uniphier_system_bus_probe(struct platform_device *pdev)
|
||||||
if (!priv)
|
if (!priv)
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
|
|
||||||
regs = platform_get_resource(pdev, IORESOURCE_MEM, 0);
|
priv->membase = devm_platform_ioremap_resource(pdev, 0);
|
||||||
priv->membase = devm_ioremap_resource(dev, regs);
|
|
||||||
if (IS_ERR(priv->membase))
|
if (IS_ERR(priv->membase))
|
||||||
return PTR_ERR(priv->membase);
|
return PTR_ERR(priv->membase);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue