public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH linux-next] sparc: leon: grpci1: use devm_platform_ioremap_resource()
@ 2022-11-30  7:53 zhang.songyi
  0 siblings, 0 replies; only message in thread
From: zhang.songyi @ 2022-11-30  7:53 UTC (permalink / raw)
  To: davem; +Cc: zhang.songyi, sparclinux, linux-kernel

From: zhang songyi <zhang.songyi@zte.com.cn>

Use the devm_platform_ioremap_resource() helper instead of
calling platform_get_resource() and devm_ioremap_resource()
separately

Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
 arch/sparc/kernel/leon_pci_grpci1.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/sparc/kernel/leon_pci_grpci1.c b/arch/sparc/kernel/leon_pci_grpci1.c
index e6935d0ac1ec..bbe9c95541e0 100644
--- a/arch/sparc/kernel/leon_pci_grpci1.c
+++ b/arch/sparc/kernel/leon_pci_grpci1.c
@@ -515,7 +515,6 @@ static int grpci1_of_probe(struct platform_device *ofdev)
        int err, len;
        const int *tmp;
        u32 cfg, size, err_mask;
-       struct resource *res;

        if (grpci1priv) {
                dev_err(&ofdev->dev, "only one GRPCI1 supported\n");
@@ -536,8 +535,7 @@ static int grpci1_of_probe(struct platform_device *ofdev)
        priv->dev = &ofdev->dev;

        /* find device register base address */
-       res = platform_get_resource(ofdev, IORESOURCE_MEM, 0);
-       regs = devm_ioremap_resource(&ofdev->dev, res);
+       regs = devm_platform_ioremap_resource(ofdev, 0);
        if (IS_ERR(regs))
                return PTR_ERR(regs);

--
2.15.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2022-11-30  7:53 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-11-30  7:53 [PATCH linux-next] sparc: leon: grpci1: use devm_platform_ioremap_resource() zhang.songyi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox