public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Corey Minyard <minyard@acm.org>
To: YueHaibing <yuehaibing@huawei.com>
Cc: arnd@arndb.de, gregkh@linuxfoundation.org,
	openipmi-developer@lists.sourceforge.net,
	linux-kernel@vger.kernel.org,
	"Alistair Popple" <alistair@popple.id.au>,
	"Cédric Le Goater" <clg@kaod.org>
Subject: Re: [PATCH -next] ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code
Date: Wed, 16 Oct 2019 09:19:36 -0500	[thread overview]
Message-ID: <20191016141936.GN14232@t560> (raw)
In-Reply-To: <20191016092131.23096-1-yuehaibing@huawei.com>

On Wed, Oct 16, 2019 at 05:21:31PM +0800, YueHaibing wrote:
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.

Adding the module author and others. I can't see a reason to not do
this.

-corey

> 
> Signed-off-by: YueHaibing <yuehaibing@huawei.com>
> ---
>  drivers/char/ipmi/bt-bmc.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/char/ipmi/bt-bmc.c b/drivers/char/ipmi/bt-bmc.c
> index 40b9927..d36aeac 100644
> --- a/drivers/char/ipmi/bt-bmc.c
> +++ b/drivers/char/ipmi/bt-bmc.c
> @@ -444,15 +444,13 @@ static int bt_bmc_probe(struct platform_device *pdev)
>  
>  	bt_bmc->map = syscon_node_to_regmap(pdev->dev.parent->of_node);
>  	if (IS_ERR(bt_bmc->map)) {
> -		struct resource *res;
>  		void __iomem *base;
>  
>  		/*
>  		 * Assume it's not the MFD-based devicetree description, in
>  		 * which case generate a regmap ourselves
>  		 */
> -		res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -		base = devm_ioremap_resource(&pdev->dev, res);
> +		base = devm_platform_ioremap_resource(pdev, 0);
>  		if (IS_ERR(base))
>  			return PTR_ERR(base);
>  
> -- 
> 2.7.4
> 
> 

  reply	other threads:[~2019-10-16 14:19 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16  9:21 [PATCH -next] ipmi: bt-bmc: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-10-16 14:19 ` Corey Minyard [this message]
2019-10-16 14:41   ` Cédric Le Goater
2019-10-16 15:20     ` Corey Minyard

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=20191016141936.GN14232@t560 \
    --to=minyard@acm.org \
    --cc=alistair@popple.id.au \
    --cc=arnd@arndb.de \
    --cc=clg@kaod.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=openipmi-developer@lists.sourceforge.net \
    --cc=yuehaibing@huawei.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