linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 01/10] Input: bcm-keypad - Convert to devm_platform_ioremap_resource()
@ 2023-07-05  5:23 Yangtao Li
  2023-07-05  5:23 ` [PATCH 02/10] Input: lpc32xx-keys " Yangtao Li
                   ` (9 more replies)
  0 siblings, 10 replies; 14+ messages in thread
From: Yangtao Li @ 2023-07-05  5:23 UTC (permalink / raw)
  To: Dmitry Torokhov; +Cc: Yangtao Li, linux-input, linux-kernel

Use devm_platform_ioremap_resource() to simplify code.

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

diff --git a/drivers/input/keyboard/bcm-keypad.c b/drivers/input/keyboard/bcm-keypad.c
index 56a919ec23b5..92e1fbb092b8 100644
--- a/drivers/input/keyboard/bcm-keypad.c
+++ b/drivers/input/keyboard/bcm-keypad.c
@@ -307,7 +307,6 @@ static int bcm_kp_probe(struct platform_device *pdev)
 {
 	struct bcm_kp *kp;
 	struct input_dev *input_dev;
-	struct resource *res;
 	int error;
 
 	kp = devm_kzalloc(&pdev->dev, sizeof(*kp), GFP_KERNEL);
@@ -353,14 +352,7 @@ static int bcm_kp_probe(struct platform_device *pdev)
 		return error;
 	}
 
-	/* Get the KEYPAD base address */
-	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-	if (!res) {
-		dev_err(&pdev->dev, "Missing keypad base address resource\n");
-		return -ENODEV;
-	}
-
-	kp->base = devm_ioremap_resource(&pdev->dev, res);
+	kp->base = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(kp->base))
 		return PTR_ERR(kp->base);
 
-- 
2.39.0


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2023-07-11 18:28 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-07-05  5:23 [PATCH 01/10] Input: bcm-keypad - Convert to devm_platform_ioremap_resource() 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 ` [PATCH 04/10] Input: omap4-keyad - Convert to devm_platform_ioremap_resource() Yangtao Li
2023-07-05  5:23 ` [PATCH 05/10] Input: opencores-kbd " 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

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).