linux-mips.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH linux-next] mips/pci: use devm_platform_ioremap_resource()
@ 2022-11-30  7:51 zhang.songyi
  2022-12-01 10:52 ` Thomas Bogendoerfer
  0 siblings, 1 reply; 3+ messages in thread
From: zhang.songyi @ 2022-11-30  7:51 UTC (permalink / raw)
  To: tsbogend; +Cc: zhang.songyi, cgel.zte, chi.minghao, linux-mips, 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/mips/pci/pci-rt3883.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/mips/pci/pci-rt3883.c b/arch/mips/pci/pci-rt3883.c
index e07ae098bdd8..d59888aaed81 100644
--- a/arch/mips/pci/pci-rt3883.c
+++ b/arch/mips/pci/pci-rt3883.c
@@ -404,7 +404,6 @@ static int rt3883_pci_probe(struct platform_device *pdev)
        struct rt3883_pci_controller *rpc;
        struct device *dev = &pdev->dev;
        struct device_node *np = dev->of_node;
-       struct resource *res;
        struct device_node *child;
        u32 val;
        int err;
@@ -414,8 +413,7 @@ static int rt3883_pci_probe(struct platform_device *pdev)
        if (!rpc)
                return -ENOMEM;

-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rpc->base = devm_ioremap_resource(dev, res);
+       rpc->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(rpc->base))
                return PTR_ERR(rpc->base);

--
2.15.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH linux-next] mips/pci: use devm_platform_ioremap_resource()
  2022-11-30  7:51 [PATCH linux-next] mips/pci: use devm_platform_ioremap_resource() zhang.songyi
@ 2022-12-01 10:52 ` Thomas Bogendoerfer
  0 siblings, 0 replies; 3+ messages in thread
From: Thomas Bogendoerfer @ 2022-12-01 10:52 UTC (permalink / raw)
  To: zhang.songyi; +Cc: cgel.zte, chi.minghao, linux-mips, linux-kernel

On Wed, Nov 30, 2022 at 03:51:25PM +0800, zhang.songyi@zte.com.cn wrote:
> 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/mips/pci/pci-rt3883.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/arch/mips/pci/pci-rt3883.c b/arch/mips/pci/pci-rt3883.c
> index e07ae098bdd8..d59888aaed81 100644
> --- a/arch/mips/pci/pci-rt3883.c
> +++ b/arch/mips/pci/pci-rt3883.c
> @@ -404,7 +404,6 @@ static int rt3883_pci_probe(struct platform_device *pdev)
>         struct rt3883_pci_controller *rpc;
>         struct device *dev = &pdev->dev;
>         struct device_node *np = dev->of_node;
> -       struct resource *res;
>         struct device_node *child;
>         u32 val;
>         int err;
> @@ -414,8 +413,7 @@ static int rt3883_pci_probe(struct platform_device *pdev)
>         if (!rpc)
>                 return -ENOMEM;
> 
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       rpc->base = devm_ioremap_resource(dev, res);
> +       rpc->base = devm_platform_ioremap_resource(pdev, 0);
>         if (IS_ERR(rpc->base))
>                 return PTR_ERR(rpc->base);
> 
> --
> 2.15.2

this patch doesn't apply because it's white-space damaged.

Thomas.

-- 
Crap can work. Given enough thrust pigs will fly, but it's not necessarily a
good idea.                                                [ RFC1925, 2.3 ]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [PATCH linux-next] mips/pci: use devm_platform_ioremap_resource()
@ 2022-11-30  7:49 zhang.songyi
  0 siblings, 0 replies; 3+ messages in thread
From: zhang.songyi @ 2022-11-30  7:49 UTC (permalink / raw)
  To: john; +Cc: tsbogend, zhang.songyi, linux-mips, 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/mips/pci/pci-rt3883.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/mips/pci/pci-rt3883.c b/arch/mips/pci/pci-rt3883.c
index e07ae098bdd8..d59888aaed81 100644
--- a/arch/mips/pci/pci-rt3883.c
+++ b/arch/mips/pci/pci-rt3883.c
@@ -404,7 +404,6 @@ static int rt3883_pci_probe(struct platform_device *pdev)
        struct rt3883_pci_controller *rpc;
        struct device *dev = &pdev->dev;
        struct device_node *np = dev->of_node;
-       struct resource *res;
        struct device_node *child;
        u32 val;
        int err;
@@ -414,8 +413,7 @@ static int rt3883_pci_probe(struct platform_device *pdev)
        if (!rpc)
                return -ENOMEM;

-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       rpc->base = devm_ioremap_resource(dev, res);
+       rpc->base = devm_platform_ioremap_resource(pdev, 0);
        if (IS_ERR(rpc->base))
                return PTR_ERR(rpc->base);

--
2.15.2

^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2022-12-01 10:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-30  7:51 [PATCH linux-next] mips/pci: use devm_platform_ioremap_resource() zhang.songyi
2022-12-01 10:52 ` Thomas Bogendoerfer
  -- strict thread matches above, loose matches on Subject: below --
2022-11-30  7:49 zhang.songyi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).