Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: ep93xx_keypad - use devm_platform_ioremap_resource() helper

Use the devm_platform_ioremap_resource() helper instead of calling
platform_get_resource() and devm_ioremap_resource() separately. This
makes 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>
Link: https://lore.kernel.org/r/20220418015036.2556731-1-lv.ruyi@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Lv Ruyi and committed by
Dmitry Torokhov
28e26e92 41657514

+1 -6
+1 -6
drivers/input/keyboard/ep93xx_keypad.c
··· 231 231 struct ep93xx_keypad *keypad; 232 232 const struct matrix_keymap_data *keymap_data; 233 233 struct input_dev *input_dev; 234 - struct resource *res; 235 234 int err; 236 235 237 236 keypad = devm_kzalloc(&pdev->dev, sizeof(*keypad), GFP_KERNEL); ··· 249 250 if (keypad->irq < 0) 250 251 return keypad->irq; 251 252 252 - res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 253 - if (!res) 254 - return -ENXIO; 255 - 256 - keypad->mmio_base = devm_ioremap_resource(&pdev->dev, res); 253 + keypad->mmio_base = devm_platform_ioremap_resource(pdev, 0); 257 254 if (IS_ERR(keypad->mmio_base)) 258 255 return PTR_ERR(keypad->mmio_base); 259 256