From: Alexander Sverdlin <alexander.sverdlin@gmail.com>
To: cgel.zte@gmail.com, dmitry.torokhov@gmail.com
Cc: lv.ruyi@zte.com.cn, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org, Zeal Robot <zealci@zte.com.cn>
Subject: Re: [PATCH] input: Make use of the helper function devm_platform_ioremap_resource()
Date: Mon, 18 Apr 2022 09:02:44 +0200 [thread overview]
Message-ID: <2cc9141e27d6c5317a8129af60decd30ac8470ce.camel@gmail.com> (raw)
In-Reply-To: <20220418015036.2556731-1-lv.ruyi@zte.com.cn>
Hello Lv!
On Mon, 2022-04-18 at 01:50 +0000, cgel.zte@gmail.com wrote:
> From: Lv Ruyi <lv.ruyi@zte.com.cn>
>
> Use the devm_platform_ioremap_resource() helper instead of calling
> platform_get_resource() and devm_ioremap_resource() separately.Make the
> code simpler without functional changes.
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Lv Ruyi <lv.ruyi@zte.com.cn>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>
> ---
> drivers/input/keyboard/ep93xx_keypad.c | 7 +------
> 1 file changed, 1 insertion(+), 6 deletions(-)
>
> diff --git a/drivers/input/keyboard/ep93xx_keypad.c b/drivers/input/keyboard/ep93xx_keypad.c
> index 272a4f1c6e81..7a3b0664ab4f 100644
> --- a/drivers/input/keyboard/ep93xx_keypad.c
> +++ b/drivers/input/keyboard/ep93xx_keypad.c
> @@ -231,7 +231,6 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
> struct ep93xx_keypad *keypad;
> const struct matrix_keymap_data *keymap_data;
> struct input_dev *input_dev;
> - struct resource *res;
> int err;
>
> keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL);
> @@ -250,11 +249,7 @@ static int ep93xx_keypad_probe(struct platform_device *pdev)
> if (keypad->irq < 0)
> return keypad->irq;
>
> - res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> - if (!res)
> - return -ENXIO;
> -
> - keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res);
> + keypad->mmio_base = devm_platform_ioremap_resource(pdev, 0);
> if (IS_ERR(keypad->mmio_base))
> return PTR_ERR(keypad->mmio_base);
>
--
Alexander Sverdlin.
next prev parent reply other threads:[~2022-04-18 7:02 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-04-18 1:50 [PATCH] input: Make use of the helper function devm_platform_ioremap_resource() cgel.zte
2022-04-18 7:02 ` Alexander Sverdlin [this message]
2022-04-20 21:48 ` Dmitry Torokhov
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=2cc9141e27d6c5317a8129af60decd30ac8470ce.camel@gmail.com \
--to=alexander.sverdlin@gmail.com \
--cc=cgel.zte@gmail.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=lv.ruyi@zte.com.cn \
--cc=zealci@zte.com.cn \
/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