From: Tony Lindgren <tony@atomide.com>
To: Linus Walleij <linus.walleij@linaro.org>
Cc: Sanjeev Sharma <sanjeev_sharma@mentor.com>,
Haojian Zhuang <haojian.zhuang@linaro.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] pinctrl:Convert the composition of devm_request_mem_region and devm_ioremap to a single call
Date: Thu, 3 Dec 2015 13:44:16 -0800 [thread overview]
Message-ID: <20151203214415.GC23396@atomide.com> (raw)
In-Reply-To: <CACRpkdZFhseQDbXvJg1CP3+WRsw_dPivx0w8730-9FV3fwjUGQ@mail.gmail.com>
* Linus Walleij <linus.walleij@linaro.org> [151030 12:54]:
> Please run posts like this by the maintainers. Tony Lindgren is one
> user, Haojian is another.
I think we need to add ourselves to MAINTAINERS for this driver,
otherwise we'll keep on missing emails.
> On Fri, Oct 30, 2015 at 8:51 AM, Sanjeev Sharma
> <sanjeev_sharma@mentor.com> wrote:
> > Use devm_ioremap_resource() in order to make the code simpler,
> > and remove redundant return value check of platform_get_resource()
> > because this value is alreadytaken care by devm_ioremap_resource()
> >
> > Signed-off-by: Sanjeev Sharma <sanjeev_sharma@mentor.com>
> > ---
> > drivers/pinctrl/pinctrl-single.c | 21 +++------------------
> > 1 file changed, 3 insertions(+), 18 deletions(-)
> >
> > diff --git a/drivers/pinctrl/pinctrl-single.c b/drivers/pinctrl/pinctrl-single.c
> > index ef04b96..905cc0a 100644
> > --- a/drivers/pinctrl/pinctrl-single.c
> > +++ b/drivers/pinctrl/pinctrl-single.c
> > @@ -1865,24 +1865,9 @@ static int pcs_probe(struct platform_device *pdev)
> > "pinctrl-single,bit-per-mux");
> >
> > res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> > - if (!res) {
> > - dev_err(pcs->dev, "could not get resource\n");
> > - return -ENODEV;
> > - }
> > -
> > - pcs->res = devm_request_mem_region(pcs->dev, res->start,
> > - resource_size(res), DRIVER_NAME);
> > - if (!pcs->res) {
> > - dev_err(pcs->dev, "could not get mem_region\n");
> > - return -EBUSY;
> > - }
> > -
> > - pcs->size = resource_size(pcs->res);
> > - pcs->base = devm_ioremap(pcs->dev, pcs->res->start, pcs->size);
> > - if (!pcs->base) {
> > - dev_err(pcs->dev, "could not ioremap\n");
> > - return -ENODEV;
> > - }
> > + pcs->base = devm_ioremap_resource(pcs->dev, res);
> > + if (IS_ERR(pcs->base))
> > + return PTR_ERR(pcs->base);
> >
> > INIT_RADIX_TREE(&pcs->pgtree, GFP_KERNEL);
> > INIT_RADIX_TREE(&pcs->ftree, GFP_KERNEL);
This won't work, we're using the physical address from pcs->res in the
code at least in pcs_add_pin.
Regards,
Tony
next prev parent reply other threads:[~2015-12-03 21:44 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 7:51 [PATCH] pinctrl:Convert the composition of devm_request_mem_region and devm_ioremap to a single call Sanjeev Sharma
2015-10-30 19:53 ` Linus Walleij
2015-12-03 21:44 ` Tony Lindgren [this message]
2015-12-10 18:17 ` Linus Walleij
2015-12-10 22:31 ` Tony Lindgren
2015-12-14 14:03 ` Linus Walleij
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=20151203214415.GC23396@atomide.com \
--to=tony@atomide.com \
--cc=haojian.zhuang@linaro.org \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sanjeev_sharma@mentor.com \
/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).