On Mon, Mar 04, 2013 at 10:36:44AM +0530, Sachin Kamat wrote: > Use the newly introduced devm_ioremap_resource() instead of > devm_request_and_ioremap() which provides more consistent error handling. > > devm_ioremap_resource() provides its own error messages; so all explicit > error messages can be removed from the failure code paths. > > Signed-off-by: Sachin Kamat <sachin.kamat@xxxxxxxxxx> > Cc: Paul Mundt <lethal@xxxxxxxxxxxx> > --- > drivers/watchdog/shwdt.c | 7 ++++--- > 1 files changed, 4 insertions(+), 3 deletions(-) > > diff --git a/drivers/watchdog/shwdt.c b/drivers/watchdog/shwdt.c > index 6a89e40..6185af2 100644 > --- a/drivers/watchdog/shwdt.c > +++ b/drivers/watchdog/shwdt.c > @@ -34,6 +34,7 @@ > #include <linux/slab.h> > #include <linux/io.h> > #include <linux/clk.h> > +#include <linux/err.h> > #include <asm/watchdog.h> > > #define DRV_NAME "sh-wdt" > @@ -249,9 +250,9 @@ static int sh_wdt_probe(struct platform_device *pdev) > wdt->clk = NULL; > } > > - wdt->base = devm_request_and_ioremap(wdt->dev, res); > - if (unlikely(!wdt->base)) { > - rc = -EADDRNOTAVAIL; > + wdt->base = devm_ioremap_resource(wdt->dev, res); > + if (IS_ERR(wdt->base)) { > + rc = PTR_ERR(wdt->base); > goto err; > } Reviewed-by: Thierry Reding <thierry.reding@xxxxxxxxxxxxxxxxx>
Attachment:
pgp2KTGo9bTJL.pgp
Description: PGP signature