mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Teresa Remmet <t.remmet@phytec.de>
Cc: Barebox List <barebox@lists.infradead.org>
Subject: Re: [PATCH 3/3] driver: replace dev_request_mem_region with dev_request_mem_resource
Date: Mon, 29 Feb 2016 07:41:49 +0100	[thread overview]
Message-ID: <20160229064149.GA9224@pengutronix.de> (raw)
In-Reply-To: <1456475830.3401.8.camel@lws-tremmet.phytec.de>

On Fri, Feb 26, 2016 at 09:37:10AM +0100, Teresa Remmet wrote:
> Hello Sascha,
> 
> Am Donnerstag, den 18.02.2016, 11:50 +0100 schrieb Sascha Hauer:
> > dev_request_mem_region doesn't work properly one some SoCs on which
> > PTR_ERR() values clash with valid return values from dev_request_mem_region.
> > Replace them with dev_request_mem_resource where possible.
> > 
> > This patch has been generated with the following semantic patch.
> > 
> > expression d;
> > expression n;
> > expression io;
> > identifier func;
> > @@
> > func(...) {
> > +struct resource *iores;
> > <+...
> > -io = dev_request_mem_region(d, n);
> > -if (IS_ERR(io)) {
> > +iores = dev_request_mem_resource(d, n);
> > +if (IS_ERR(iores)) {
> > ...
> > -	return PTR_ERR(io);
> > -}
> > +	return PTR_ERR(iores);
> > +}
> > +io = IOMEM(iores->start);
> > ...+>
> > }
> > 
> > @@
> > expression d;
> > expression n;
> > expression io;
> > identifier func;
> > @@
> > func(...) {
> > +struct resource *iores;
> > <+...
> > -io = dev_request_mem_region(d, n);
> > -if (IS_ERR(io)) {
> > +iores = dev_request_mem_resource(d, n);
> > +if (IS_ERR(iores))
> > -	return PTR_ERR(io);
> > -}
> > +	return PTR_ERR(iores);
> > +io = IOMEM(iores->start);
> > ...+>
> > }
> > 
> > @@
> > expression d;
> > expression n;
> > expression io;
> > identifier func;
> > @@
> > func(...) {
> > +struct resource *iores;
> > <+...
> > -io = dev_request_mem_region(d, n);
> > -if (IS_ERR(io)) {
> > -	ret = PTR_ERR(io);
> > +iores = dev_request_mem_resource(d, n);
> > +if (IS_ERR(iores)) {
> > +	ret = PTR_ERR(iores);
> 
> here you seem to miss:
> 
> io = IOMEM(iores->start);

Oh, indeed. Thanks for noting. Fixed this up

Sascha



-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2016-02-29  6:42 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-02-18 10:50 [PATCH] dev_request_mem_region -> dev_request_mem_resource conversion Sascha Hauer
2016-02-18 10:50 ` [PATCH 1/3] Fix return check of dev_request_mem_region Sascha Hauer
2016-02-19  0:58   ` Andrey Smirnov
2016-02-19  8:29     ` Sascha Hauer
2016-02-19 19:12       ` Andrey Smirnov
2016-02-23  7:15         ` Sascha Hauer
2016-02-18 10:50 ` [PATCH 2/3] driver: Introduce dev_request_mem_resource Sascha Hauer
2016-02-18 10:50 ` [PATCH 3/3] driver: replace dev_request_mem_region with dev_request_mem_resource Sascha Hauer
2016-02-26  8:37   ` Teresa Remmet
2016-02-29  6:41     ` Sascha Hauer [this message]

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=20160229064149.GA9224@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=barebox@lists.infradead.org \
    --cc=t.remmet@phytec.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