linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Eli Billauer <eli.billauer@gmail.com>
To: YueHaibing <yuehaibing@huawei.com>
Cc: arnd@arndb.de, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] char: xillybus: use devm_platform_ioremap_resource() to simplify code
Date: Wed, 16 Oct 2019 18:01:06 +0300	[thread overview]
Message-ID: <5DA730B2.2@gmail.com> (raw)
In-Reply-To: <20191016092546.26332-1-yuehaibing@huawei.com>

Hello,

Thanks for the patch.

I have to admit that this goes slightly against my instinct not to touch 
code that works. But I'll leave the tradeoff to people who know better 
than me.

Anyhow, I've verified that it compiles well, and the functional 
equivalence is quite obvious.

Regards,
    Eli

Acked-by: Eli Billauer <eli.billauer@gmail.com>

On 16/10/19 12:25, YueHaibing wrote:
> Use devm_platform_ioremap_resource() to simplify the code a bit.
> This is detected by coccinelle.
>
> Signed-off-by: YueHaibing<yuehaibing@huawei.com>
> ---
>   drivers/char/xillybus/xillybus_of.c | 5 +----
>   1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/drivers/char/xillybus/xillybus_of.c b/drivers/char/xillybus/xillybus_of.c
> index bfafd8f..96b6de8 100644
> --- a/drivers/char/xillybus/xillybus_of.c
> +++ b/drivers/char/xillybus/xillybus_of.c
> @@ -116,7 +116,6 @@ static int xilly_drv_probe(struct platform_device *op)
>   	struct xilly_endpoint *endpoint;
>   	int rc;
>   	int irq;
> -	struct resource *res;
>   	struct xilly_endpoint_hardware *ephw =&of_hw;
>
>   	if (of_property_read_bool(dev->of_node, "dma-coherent"))
> @@ -129,9 +128,7 @@ static int xilly_drv_probe(struct platform_device *op)
>
>   	dev_set_drvdata(dev, endpoint);
>
> -	res = platform_get_resource(op, IORESOURCE_MEM, 0);
> -	endpoint->registers = devm_ioremap_resource(dev, res);
> -
> +	endpoint->registers = devm_platform_ioremap_resource(op, 0);
>   	if (IS_ERR(endpoint->registers))
>   		return PTR_ERR(endpoint->registers);
>
>    


      reply	other threads:[~2019-10-16 15:01 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-16  9:25 [PATCH -next] char: xillybus: use devm_platform_ioremap_resource() to simplify code YueHaibing
2019-10-16 15:01 ` Eli Billauer [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=5DA730B2.2@gmail.com \
    --to=eli.billauer@gmail.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --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;
as well as URLs for NNTP newsgroup(s).