Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp1012917ybi; Fri, 14 Jun 2019 07:11:15 -0700 (PDT) X-Google-Smtp-Source: APXvYqyWiSG5q8IXc2ylhw4+FYltvUSkq+x0zwBqWYtdv3IruqLQ0fuOqYBk6MOm49Tz8rc1XX5F X-Received: by 2002:a62:770e:: with SMTP id s14mr67096580pfc.150.1560521475089; Fri, 14 Jun 2019 07:11:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560521475; cv=none; d=google.com; s=arc-20160816; b=FgIWuIbyw/qDR16qVlfZqtF6SporOiQXieD14cSWi0kgffnbhxPP/StDk3FQdlN3lW IAQJfA+3M9M4Dwy70DGCq41o1zmUzvgCmOyZCst6KM60jvPkzeFnZpRuR767a2iDlFT5 5RK1r/+vyHPC0c9KW6MgAw0eBkACJBcqjYG/YG821yk00I4TqLgAkE4TbauGQyPdNPoD 2050sMO2EMdq+Rcy8qn1Tb+FLP9E+I/h43F1YqFPAsXUm5tvzVGY58f3EzSKoHFqpSO0 /MhKT/bRdx1u/JqcxHM5r531Ds5taw35pX/JWv86mhbRCwW8iVplSSFZyAE1+PctcX4T e9iw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-transfer-encoding:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=IxAcNsywMZtxu1YGakK+E+m+lgfD5xD7Lk4C55TYhOA=; b=wMt2qd9Pzo3NtYSIbJYm3wIfMYKB9m2lFH2gkGP9/6BnVcAlBVvVqDRwtiEpHqy/ac ktPiwk0PgB2bUZnr18Sj+5PlpfcYonxzaH/TeNh8APyxYZ4Ys2vU+BmiKjN2+dtwkiQH LD6mfM2nF7MxFcgp8RSgZWAhnkapWcFWDpGQHeCIO2edor1Vz711sx9hWVq75NMDTTvt qaT4Zvk6w1XbL8YwJLgbnBdk0IHQYDx+j6YX/ixvJU01seNqSFD+o1OpWJvdG+BrfvDp KWNoIzbsy+yPSyo9ftWWEIgKTcNOOKkiGHcX9FComSZJJvF/0IRprWBMjAeqg9dCCA56 zoFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qZCdPdQZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j18si2528836pfi.75.2019.06.14.07.10.57; Fri, 14 Jun 2019 07:11:15 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=qZCdPdQZ; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728795AbfFNOKI (ORCPT + 99 others); Fri, 14 Jun 2019 10:10:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:54392 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbfFNOKI (ORCPT ); Fri, 14 Jun 2019 10:10:08 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4826821721; Fri, 14 Jun 2019 14:10:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560521406; bh=X3olSuNcAEC4oKTYoE6rwJUp6F7cA7DAFJwXvntbFZ4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=qZCdPdQZfEwHNfS1xlho9YTjV85ahmdys2IFn8rEms4D6V842SVLCqeSXEw3pePhD g1GXkXCuZikiXJtCdZnAwpn5tgzRwjVDscNV386/YaPYhWhvFgHU0ZqQV9CAmqaPZL pLUQDNGl0AWOgS1B6+W+7D9tWvNw/Fnsodc95VCs= Date: Fri, 14 Jun 2019 16:10:04 +0200 From: Greg Kroah-Hartman To: Andy Shevchenko Cc: Markus Elfring , Jack Ping CHNG , kernel-janitors@vger.kernel.org, "Rafael J. Wysocki" , LKML , Bartosz Golaszewski , Enrico Weigelt , Himanshu Jha , Linus Walleij Subject: Re: [PATCH] drivers: Provide devm_platform_ioremap_resource_byname() Message-ID: <20190614141004.GC7234@kroah.com> References: <39e46643-d799-94b7-4aa5-d6d99d738f99@web.de> <20190614133840.GN9224@smile.fi.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190614133840.GN9224@smile.fi.intel.com> User-Agent: Mutt/1.12.0 (2019-05-25) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > > 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. 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 > > > > > Signed-off-by: Markus Elfring > > --- > > 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. thanks, greg k-h