mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Yangtao Li <frank.li@vivo.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Yangtao Li <frank.li@vivo.com>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 04/10] Input: omap4-keyad - Convert to devm_platform_ioremap_resource()
Date: Wed,  5 Jul 2023 13:23:40 +0800	[thread overview]
Message-ID: <20230705052346.39337-4-frank.li@vivo.com> (raw)
In-Reply-To: <20230705052346.39337-1-frank.li@vivo.com>

Use devm_platform_ioremap_resource() to simplify code.

Signed-off-by: Yangtao Li <frank.li@vivo.com>
---
 drivers/input/keyboard/omap4-keypad.c | 9 +--------
 1 file changed, 1 insertion(+), 8 deletions(-)

diff --git a/drivers/input/keyboard/omap4-keypad.c b/drivers/input/keyboard/omap4-keypad.c
index 9f085d5679db..773e55eed88b 100644
--- a/drivers/input/keyboard/omap4-keypad.c
+++ b/drivers/input/keyboard/omap4-keypad.c
@@ -341,17 +341,10 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 	struct device *dev = &pdev->dev;
 	struct omap4_keypad *keypad_data;
 	struct input_dev *input_dev;
-	struct resource *res;
 	unsigned int max_keys;
 	int irq;
 	int error;
 
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "no base address specified\n");
-		return -EINVAL;
-	}
-
 	irq = platform_get_irq(pdev, 0);
 	if (irq < 0)
 		return irq;
@@ -370,7 +363,7 @@ static int omap4_keypad_probe(struct platform_device *pdev)
 	if (error)
 		return error;
 
-	keypad_data->base = devm_ioremap_resource(dev, res);
+	keypad_data->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(keypad_data->base))
 		return PTR_ERR(keypad_data->base);
 
-- 
2.39.0


  parent reply	other threads:[~2023-07-05  5:24 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-05  5:23 [PATCH 01/10] Input: bcm-keypad " Yangtao Li
2023-07-05  5:23 ` [PATCH 02/10] Input: lpc32xx-keys " Yangtao Li
2023-07-05  5:23 ` [PATCH 03/10] Input: nspire-keypad - Use devm_platform_get_and_ioremap_resource() Yangtao Li
2023-07-05  5:23 ` Yangtao Li [this message]
2023-07-05  5:23 ` [PATCH 05/10] Input: opencores-kbd - Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-05  5:23 ` [PATCH 06/10] Input: pxa27x_keypad " Yangtao Li
2023-07-05  5:23 ` [PATCH 07/10] Input: sun4i-lradc-keys " Yangtao Li
2023-07-11 18:27   ` Jernej Škrabec
2023-07-05  5:23 ` [PATCH 08/10] Input: nomadik-ske-keypad - Convert to use devm_* api Yangtao Li
2023-07-11  0:42   ` Dmitry Torokhov
2023-07-05  5:23 ` [PATCH 09/10] Input: lpc32xx_ts - stop_tsc when driver remove Yangtao Li
2023-07-11  0:40   ` Dmitry Torokhov
2023-07-05  5:23 ` [PATCH 10/10] Input: lpc32xx_ts - Convert to use devm_* api Yangtao Li
2023-07-11  0:43 ` [PATCH 01/10] Input: bcm-keypad - Convert to devm_platform_ioremap_resource() 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=20230705052346.39337-4-frank.li@vivo.com \
    --to=frank.li@vivo.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®