linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 13/27] drivers/pci/host: don't check resource with devm_ioremap_resource
       [not found] <1374602524-3398-1-git-send-email-wsa@the-dreams.de>
@ 2013-07-23 18:01 ` Wolfram Sang
  2013-07-23 18:12   ` Bjorn Helgaas
  0 siblings, 1 reply; 3+ messages in thread
From: Wolfram Sang @ 2013-07-23 18:01 UTC (permalink / raw)
  To: linux-kernel; +Cc: Wolfram Sang, Bjorn Helgaas, linux-pci

devm_ioremap_resource does sanity checks on the given resource. No need to
duplicate this in the driver.

Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
---
Please apply via the subsystem-tree.

 drivers/pci/host/pcie-designware.c |   12 ------------
 1 file changed, 12 deletions(-)

diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
index 26bdbda..f0ba6ef 100644
--- a/drivers/pci/host/pcie-designware.c
+++ b/drivers/pci/host/pcie-designware.c
@@ -817,28 +817,16 @@ static int add_pcie_port(struct pcie_port *pp, struct platform_device *pdev)
 	int ret;
 
 	elbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!elbi_base) {
-		dev_err(&pdev->dev, "couldn't get elbi base resource\n");
-		return -EINVAL;
-	}
 	pp->elbi_base = devm_ioremap_resource(&pdev->dev, elbi_base);
 	if (IS_ERR(pp->elbi_base))
 		return PTR_ERR(pp->elbi_base);
 
 	phy_base = platform_get_resource(pdev, IORESOURCE_MEM, 1);
-	if (!phy_base) {
-		dev_err(&pdev->dev, "couldn't get phy base resource\n");
-		return -EINVAL;
-	}
 	pp->phy_base = devm_ioremap_resource(&pdev->dev, phy_base);
 	if (IS_ERR(pp->phy_base))
 		return PTR_ERR(pp->phy_base);
 
 	purple_base = platform_get_resource(pdev, IORESOURCE_MEM, 2);
-	if (!purple_base) {
-		dev_err(&pdev->dev, "couldn't get purple base resource\n");
-		return -EINVAL;
-	}
 	pp->purple_base = devm_ioremap_resource(&pdev->dev, purple_base);
 	if (IS_ERR(pp->purple_base))
 		return PTR_ERR(pp->purple_base);
-- 
1.7.10.4


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

* Re: [PATCH 13/27] drivers/pci/host: don't check resource with devm_ioremap_resource
  2013-07-23 18:01 ` [PATCH 13/27] drivers/pci/host: don't check resource with devm_ioremap_resource Wolfram Sang
@ 2013-07-23 18:12   ` Bjorn Helgaas
  2013-07-23 23:17     ` Jingoo Han
  0 siblings, 1 reply; 3+ messages in thread
From: Bjorn Helgaas @ 2013-07-23 18:12 UTC (permalink / raw)
  To: Wolfram Sang
  Cc: linux-kernel@vger.kernel.org, linux-pci@vger.kernel.org,
	Jingoo Han

[+cc Jingoo]

On Tue, Jul 23, 2013 at 12:01 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> devm_ioremap_resource does sanity checks on the given resource. No need to
> duplicate this in the driver.
>
> Signed-off-by: Wolfram Sang <wsa@the-dreams.de>

Acked-by: Bjorn Helgaas <bhelgaas@google.com>

Jingoo, I can apply this, or if you have other pcie-designware.c
updates this cycle, you can fold it into those.  Just let me know what
you'd prefer.

Bjorn


>  drivers/pci/host/pcie-designware.c |   12 ------------
>  1 file changed, 12 deletions(-)
>
> diff --git a/drivers/pci/host/pcie-designware.c b/drivers/pci/host/pcie-designware.c
> index 26bdbda..f0ba6ef 100644
> --- a/drivers/pci/host/pcie-designware.c
> +++ b/drivers/pci/host/pcie-designware.c
> @@ -817,28 +817,16 @@ static int add_pcie_port(struct pcie_port *pp, struct platform_device *pdev)
>         int ret;
>
>         elbi_base = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       if (!elbi_base) {
> -               dev_err(&pdev->dev, "couldn't get elbi base resource\n");
> -               return -EINVAL;
> -       }
>         pp->elbi_base = devm_ioremap_resource(&pdev->dev, elbi_base);
>         if (IS_ERR(pp->elbi_base))
>                 return PTR_ERR(pp->elbi_base);
>
>         phy_base = platform_get_resource(pdev, IORESOURCE_MEM, 1);
> -       if (!phy_base) {
> -               dev_err(&pdev->dev, "couldn't get phy base resource\n");
> -               return -EINVAL;
> -       }
>         pp->phy_base = devm_ioremap_resource(&pdev->dev, phy_base);
>         if (IS_ERR(pp->phy_base))
>                 return PTR_ERR(pp->phy_base);
>
>         purple_base = platform_get_resource(pdev, IORESOURCE_MEM, 2);
> -       if (!purple_base) {
> -               dev_err(&pdev->dev, "couldn't get purple base resource\n");
> -               return -EINVAL;
> -       }
>         pp->purple_base = devm_ioremap_resource(&pdev->dev, purple_base);
>         if (IS_ERR(pp->purple_base))
>                 return PTR_ERR(pp->purple_base);
> --
> 1.7.10.4
>

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

* Re: [PATCH 13/27] drivers/pci/host: don't check resource with devm_ioremap_resource
  2013-07-23 18:12   ` Bjorn Helgaas
@ 2013-07-23 23:17     ` Jingoo Han
  0 siblings, 0 replies; 3+ messages in thread
From: Jingoo Han @ 2013-07-23 23:17 UTC (permalink / raw)
  To: 'Bjorn Helgaas', 'Wolfram Sang'
  Cc: linux-kernel, linux-pci, Jingoo Han

On Wednesday, July 24, 2013 3:13 AM, Bjorn Helgaas wrote:
> On Tue, Jul 23, 2013 at 12:01 PM, Wolfram Sang <wsa@the-dreams.de> wrote:
> > devm_ioremap_resource does sanity checks on the given resource. No need to
> > duplicate this in the driver.
> >
> > Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
> 
> Acked-by: Bjorn Helgaas <bhelgaas@google.com>
> 
> Jingoo, I can apply this, or if you have other pcie-designware.c
> updates this cycle, you can fold it into those.  Just let me know what
> you'd prefer.

Hi Bjorn Helgaas,

I will send other updates for pcie-designware.c.
I will fold it into those.
Thank you.

Best regards,
Jingoo Han




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

end of thread, other threads:[~2013-07-23 23:17 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <1374602524-3398-1-git-send-email-wsa@the-dreams.de>
2013-07-23 18:01 ` [PATCH 13/27] drivers/pci/host: don't check resource with devm_ioremap_resource Wolfram Sang
2013-07-23 18:12   ` Bjorn Helgaas
2013-07-23 23:17     ` Jingoo Han

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).