[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJZ5v0iBSq+DHqkevbLS0kYbaKGM0zYjg0KAzNhqYjCXvrQ-RQ@mail.gmail.com>
Date: Mon, 17 Jun 2019 11:55:28 +0200
From: "Rafael J. Wysocki" <rafael@...nel.org>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Markus Elfring <Markus.Elfring@....de>,
Jack Ping CHNG <jack.ping.chng@...ux.intel.com>,
kernel-janitors@...r.kernel.org,
"Rafael J. Wysocki" <rafael@...nel.org>,
LKML <linux-kernel@...r.kernel.org>,
Bartosz Golaszewski <bgolaszewski@...libre.com>,
Enrico Weigelt <lkml@...ux.net>,
Himanshu Jha <himanshujha199640@...il.com>,
Linus Walleij <linus.walleij@...aro.org>
Subject: Re: [PATCH] drivers: Provide devm_platform_ioremap_resource_byname()
On Fri, Jun 14, 2019 at 4:10 PM Greg Kroah-Hartman
<gregkh@...uxfoundation.org> wrote:
>
> On Fri, Jun 14, 2019 at 04:38:40PM +0300, Andy Shevchenko wrote:
> > +Cc: Jack Ping, who did internally the same
> >
> > On Fri, Jun 14, 2019 at 03:26:25PM +0200, Markus Elfring wrote:
> > > From: Markus Elfring <elfring@...rs.sourceforge.net>
> > > Date: Fri, 14 Jun 2019 15:15:14 +0200
> > >
> > > The functions “platform_get_resource_byname” and “devm_ioremap_resource”
> > > are called together in 181 source files.
> > > This implementation detail can be determined also with the help
> > > of the semantic patch language (Coccinelle software).
> > >
> > > Wrap these two calls into another helper function.
> > > Thus a local variable does not need to be declared for a resource
> > > structure pointer before and a redundant argument can be omitted
> > > for the resource type.
> >
> > This one makes sense.
> > Though I'm not sure Greg will see your message.
>
> Nope, didn't see it, don't want to see it, it will only cause more work
> in the longrun...
>
> > Rafael, maybe you can apply this one?
>
> Um, don't go around maintainers please, that's rude.
Totally agreed.
And there would be no reason for me to even consider applying it, really.
> There is a reason this specific developer is in my blacklist, and perhaps they should be
> in yours as well :)
>
> > FWIW,
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
> >
> > >
> > > Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> > > ---
> > > drivers/base/platform.c | 18 ++++++++++++++++++
> > > 1 file changed, 18 insertions(+)
> > >
> > > diff --git a/drivers/base/platform.c b/drivers/base/platform.c
> > > index 4d1729853d1a..c1f19a479dd7 100644
> > > --- a/drivers/base/platform.c
> > > +++ b/drivers/base/platform.c
> > > @@ -97,6 +97,24 @@ void __iomem *devm_platform_ioremap_resource(struct platform_device *pdev,
> > > return devm_ioremap_resource(&pdev->dev, res);
> > > }
> > > EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource);
> > > +
> > > +/**
> > > + * devm_platform_ioremap_resource_byname
> > > + * Call devm_ioremap_resource() for a platform device
> > > + *
> > > + * @pdev: platform device to use both for memory resource lookup as well as
> > > + * resource management
> > > + * @name: resource name
> > > + */
> > > +void __iomem *devm_platform_ioremap_resource_byname(struct platform_device *pdev,
> > > + const char *name)
> > > +{
> > > + struct resource *res;
> > > +
> > > + res = platform_get_resource_byname(pdev, IORESOURCE_MEM, name);
> > > + return devm_ioremap_resource(&pdev->dev, res);
> > > +}
> > > +EXPORT_SYMBOL_GPL(devm_platform_ioremap_resource_byname);
> > > #endif /* CONFIG_HAS_IOMEM */
>
> I don't like adding new apis with no user.
I agree with that too.
Cheers!
Powered by blists - more mailing lists