From: Stephen Warren <swarren@wwwdotorg.org>
To: Joe Perches <joe@perches.com>
Cc: Wolfram Sang <wsa@the-dreams.de>,
linux-kernel@vger.kernel.org, linux-tegra@vger.kernel.org
Subject: Re: [PATCH 10/27] drivers/memory: don't check resource with devm_ioremap_resource
Date: Tue, 23 Jul 2013 18:27:57 -0700 [thread overview]
Message-ID: <51EF2D9D.8030904@wwwdotorg.org> (raw)
In-Reply-To: <1374603925.3387.26.camel@joe-AO722>
On 07/23/2013 11:25 AM, Joe Perches wrote:
> On Tue, 2013-07-23 at 20:01 +0200, Wolfram Sang wrote:
>> devm_ioremap_resource does sanity checks on the given resource. No need to
>> duplicate this in the driver.
>
> Hi Wolfram:
>
> This is the first and only one of the patch series I looked at.
>
>> diff --git a/drivers/memory/tegra20-mc.c b/drivers/memory/tegra20-mc.c
> []
>> @@ -218,8 +218,6 @@ static int tegra20_mc_probe(struct platform_device *pdev)
>> struct resource *res;
>>
>> res = platform_get_resource(pdev, IORESOURCE_MEM, i);
>> - if (!res)
>> - return -ENODEV;
>> mc->regs[i] = devm_ioremap_resource(&pdev->dev, res);
>
> I'm not so sure this is appropriate.
>
> devm_ioremap_resource returns ERR_PTR(-EINVAL) for
> null resource so this changes the return.
I think the exact return value is probably pretty arbitrary here.
> devm_ioremap_resource also emits a noisy dev_err
> message when resource is NULL.
>
> It's a probe and before the message log would be silent
> but now there's a new dmesg.
I think those changes are fine, at least for this driver. It's a bug if
the required resources are missing, and having probe() actively point
out why it's failing can only be a good thing in my book.
next prev parent reply other threads:[~2013-07-24 1:28 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1374602524-3398-1-git-send-email-wsa@the-dreams.de>
2013-07-23 18:01 ` [PATCH 01/27] arch/mips/lantiq/xway: don't check resource with devm_ioremap_resource Wolfram Sang
2013-07-23 18:02 ` John Crispin
2013-07-23 18:01 ` [PATCH 02/27] drivers/amba: " Wolfram Sang
2013-07-24 1:34 ` Stephen Warren
2013-07-23 18:01 ` [PATCH 03/27] drivers/cpuidle: " Wolfram Sang
2013-07-23 21:26 ` Rafael J. Wysocki
2013-07-23 18:01 ` [PATCH 04/27] drivers/dma: " Wolfram Sang
2013-08-19 8:58 ` Vinod Koul
2013-08-19 10:03 ` Wolfram Sang
2013-07-23 18:01 ` [PATCH 05/27] drivers/gpu/host1x/drm: " Wolfram Sang
2013-08-01 10:20 ` Terje Bergström
2013-07-23 18:01 ` [PATCH 06/27] drivers/i2c/busses: " Wolfram Sang
2013-07-29 16:39 ` Linus Walleij
2013-08-07 15:38 ` Wolfram Sang
2013-07-23 18:01 ` [PATCH 07/27] drivers/input/serio: " Wolfram Sang
2013-07-23 18:01 ` [PATCH 08/27] drivers/iommu: " Wolfram Sang
2013-07-24 1:30 ` Stephen Warren
2013-07-23 18:01 ` [PATCH 09/27] drivers/media/platform: " Wolfram Sang
2013-07-23 18:01 ` [PATCH 10/27] drivers/memory: " Wolfram Sang
2013-07-23 18:25 ` Joe Perches
2013-07-24 1:27 ` Stephen Warren [this message]
2013-07-24 1:38 ` Joe Perches
2013-07-24 1:32 ` Stephen Warren
2013-07-24 1:50 ` Joe Perches
2013-07-24 15:28 ` Wolfram Sang
2013-07-24 15:51 ` Joe Perches
2013-07-23 18:01 ` [PATCH 11/27] drivers/mtd/nand: " Wolfram Sang
2013-07-23 18:09 ` Fabio Estevam
2013-07-23 18:01 ` [PATCH 12/27] drivers/net/ethernet/stmicro/stmmac: " Wolfram Sang
2013-07-25 6:59 ` David Miller
2013-07-23 18:01 ` [PATCH 13/27] drivers/pci/host: " Wolfram Sang
2013-07-23 18:12 ` Bjorn Helgaas
2013-07-23 23:17 ` Jingoo Han
2013-07-23 18:01 ` [PATCH 14/27] drivers/pinctrl: " Wolfram Sang
2013-08-07 18:14 ` Linus Walleij
2013-07-23 18:01 ` [PATCH 15/27] drivers/pwm: " Wolfram Sang
2013-08-14 9:43 ` Thierry Reding
2013-07-23 18:01 ` [PATCH 16/27] drivers/scsi/ufs: " Wolfram Sang
2013-07-23 18:01 ` [PATCH 17/27] drivers/spi: " Wolfram Sang
2013-07-24 14:29 ` Mark Brown
2013-07-24 15:30 ` Wolfram Sang
2013-07-23 18:01 ` [PATCH 18/27] drivers/staging/imx-drm: " Wolfram Sang
2013-07-23 18:01 ` [PATCH 19/27] drivers/usb/phy: " Wolfram Sang
2013-07-23 18:01 ` [PATCH 20/27] drivers/watchdog: " Wolfram Sang
2013-07-23 18:01 ` [PATCH 21/27] sound/soc/au1x: " Wolfram Sang
2013-07-24 14:31 ` Mark Brown
2013-07-23 18:01 ` [PATCH 22/27] sound/soc/cirrus: " Wolfram Sang
2013-07-24 14:33 ` Mark Brown
2013-07-23 18:01 ` [PATCH 23/27] sound/soc/nuc900: " Wolfram Sang
2013-07-24 14:34 ` Mark Brown
2013-07-23 18:01 ` [PATCH 24/27] sound/soc/pxa: " Wolfram Sang
2013-07-24 14:35 ` Mark Brown
2013-07-23 18:01 ` [PATCH 25/27] sound/soc/tegra: " Wolfram Sang
2013-07-24 14:37 ` Mark Brown
2013-07-23 18:01 ` [PATCH 26/27] sound/soc/txx9: " Wolfram Sang
2013-07-24 14:37 ` Mark Brown
2013-07-23 18:02 ` [PATCH 27/27] thermal: ti-bandgap: cleanup resource allocation Wolfram Sang
2013-07-26 15:43 ` Eduardo Valentin
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=51EF2D9D.8030904@wwwdotorg.org \
--to=swarren@wwwdotorg.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-tegra@vger.kernel.org \
--cc=wsa@the-dreams.de \
/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).