linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
To: Jingoo Han <jg1.han@samsung.com>
Cc: 'Bjorn Helgaas' <bhelgaas@google.com>,
	linux-pci@vger.kernel.org, 'Jason Cooper' <jason@lakedaemon.net>
Subject: Re: [PATCH 3/3] PCI: mvebu: add missing __iomem annotation
Date: Tue, 17 Sep 2013 06:47:00 +0200	[thread overview]
Message-ID: <20130917064700.57964d15@skate> (raw)
In-Reply-To: <000201ceb340$21d48de0$657da9a0$%han@samsung.com>

Dear Jingoo Han,

On Tue, 17 Sep 2013 09:52:06 +0900, Jingoo Han wrote:

> 'Just returning NULL when of_address_to_resource() fails
> instead of trying to propagate the error' looks better.
> 
> Then, how about the following?
> 
> --- a/drivers/pci/host/pci-mvebu.c
> +++ b/drivers/pci/host/pci-mvebu.c
> @@ -728,7 +728,7 @@ mvebu_pcie_map_registers(struct platform_device *pdev,
> 
> 	ret = of_address_to_resource(np, 0, &regs);
> 	if (ret)
> -		return ERR_PTR(ret);
> +		return NULL;
> 
> 	return devm_ioremap_resource(&pdev->dev, &regs);
>  }
> @@ -874,7 +874,7 @@ static int __init mvebu_pcie_probe(struct platform_device *pdev)
> 		}
> 
> 		port->base = mvebu_pcie_map_registers(pdev, child, port);
> -		if (IS_ERR(port->base)) {
> +		if (!port->base) {
> 			dev_err(&pdev->dev, "PCIe%d.%d: cannot map registers\n",
>   				port->port, port->lane);
> 			port->base = NULL;

Yes, I believe it makes more sense since we were anyway to using the
error code returned by of_address_to_ressource().

However, you can get rid of the port->base = NULL assignment in the if
() { ... } code now.

With that fixed, you can add my:

Acked-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Thomas
-- 
Thomas Petazzoni, Free Electrons
Kernel, drivers, real-time and embedded Linux
development, consulting, training and support.
http://free-electrons.com

  reply	other threads:[~2013-09-17  4:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-09-12  9:32 [PATCH 1/3] PCI: tegra: add missing __iomem annotation Jingoo Han
2013-09-12  9:36 ` [PATCH 2/3] PCI: mvebu: make local functions static Jingoo Han
2013-09-12  9:37   ` Thomas Petazzoni
2013-09-12  9:37 ` [PATCH 3/3] PCI: mvebu: add missing __iomem annotation Jingoo Han
2013-09-16 15:57   ` Thomas Petazzoni
2013-09-17  0:52     ` Jingoo Han
2013-09-17  4:47       ` Thomas Petazzoni [this message]
2013-09-19 11:28 ` [PATCH 1/3] PCI: tegra: " Thierry Reding

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130917064700.57964d15@skate \
    --to=thomas.petazzoni@free-electrons.com \
    --cc=bhelgaas@google.com \
    --cc=jason@lakedaemon.net \
    --cc=jg1.han@samsung.com \
    --cc=linux-pci@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).