[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20120131101734.GE2471@pengutronix.de>
Date: Tue, 31 Jan 2012 11:17:34 +0100
From: Wolfram Sang <w.sang@...gutronix.de>
To: Barry Song <Barry.Song@....com>
Cc: Greg Kroah-Hartman <gregkh@...e.de>, linux-kernel@...r.kernel.org,
Linus Walleij <linus.walleij@...aro.org>,
workgroup.linux@....com, Grant Likely <grant.likely@...retlab.ca>,
linux-mtd@...ts.infradead.org,
Atsushi Nemoto <anemo@....ocn.ne.jp>,
Barry Song <Baohua.Song@....com>,
David Woodhouse <dwmw2@...radead.org>,
Erik Gilling <konkers@...gle.com>
Subject: Re: [PATCH 1/3] platform: add common resource requesting and
mapping helper
On Tue, Jan 31, 2012 at 06:00:00PM +0800, Barry Song wrote:
> From: Barry Song <Baohua.Song@....com>
>
> this patch helps to move the common pattern from
>
> "
> res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> if (!res) {
> ret = -ENODEV;
> goto err;
> }
You don't need to do the error checking for 'res'. You can simply do
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
base = devm_request_and_ioremap(&dev->dev, res);
devm_request_and_ioremap() will check res. Given that, I don't think
we can save a lot with another wrapper.
Thanks,
Wolfram
--
Pengutronix e.K. | Wolfram Sang |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Download attachment "signature.asc" of type "application/pgp-signature" (199 bytes)
Powered by blists - more mailing lists