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

Input: omap-keypad - drop optional GPIO support

The driver supports passing some GPIO lines for rows and columns
through the driver data, but there is no in-kernel user of this.

Further the use seems convoluted because the GPIO lines are unused
in the driver, then explicitly free:ed when removing it without
being requested when probing it, which is assymetric and just
a recepie for disaster.

Remove the support for these unused GPIOs, if need be support can
be reestablished in an organized fashion using GPIO descriptors.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20231129-descriptors-input-v1-3-9433162914a3@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Linus Walleij and committed by
Dmitry Torokhov
e53c18da 1ba05c92

+1 -21
+1 -18
drivers/input/keyboard/omap-keypad.c
··· 21 21 #include <linux/mutex.h> 22 22 #include <linux/errno.h> 23 23 #include <linux/slab.h> 24 - #include <linux/gpio.h> 25 24 #include <linux/platform_data/gpio-omap.h> 26 25 #include <linux/platform_data/keypad-omap.h> 27 26 #include <linux/soc/ti/omap1-io.h> ··· 47 48 }; 48 49 49 50 static DECLARE_TASKLET_DISABLED_OLD(kp_tasklet, omap_kp_tasklet); 50 - 51 - static unsigned int *row_gpios; 52 - static unsigned int *col_gpios; 53 51 54 52 static irqreturn_t omap_kp_interrupt(int irq, void *dev_id) 55 53 { ··· 176 180 struct omap_kp *omap_kp; 177 181 struct input_dev *input_dev; 178 182 struct omap_kp_platform_data *pdata = dev_get_platdata(&pdev->dev); 179 - int i, col_idx, row_idx, ret; 183 + int ret; 180 184 unsigned int row_shift, keycodemax; 181 185 182 186 if (!pdata->rows || !pdata->cols || !pdata->keymap_data) { ··· 205 209 if (pdata->delay) 206 210 omap_kp->delay = pdata->delay; 207 211 208 - if (pdata->row_gpios && pdata->col_gpios) { 209 - row_gpios = pdata->row_gpios; 210 - col_gpios = pdata->col_gpios; 211 - } 212 - 213 212 omap_kp->rows = pdata->rows; 214 213 omap_kp->cols = pdata->cols; 215 - 216 - col_idx = 0; 217 - row_idx = 0; 218 214 219 215 timer_setup(&omap_kp->timer, omap_kp_timer, 0); 220 216 ··· 264 276 err3: 265 277 device_remove_file(&pdev->dev, &dev_attr_enable); 266 278 err2: 267 - for (i = row_idx - 1; i >= 0; i--) 268 - gpio_free(row_gpios[i]); 269 - for (i = col_idx - 1; i >= 0; i--) 270 - gpio_free(col_gpios[i]); 271 - 272 279 kfree(omap_kp); 273 280 input_free_device(input_dev); 274 281
-3
include/linux/platform_data/keypad-omap.h
··· 19 19 bool rep; 20 20 unsigned long delay; 21 21 bool dbounce; 22 - /* specific to OMAP242x*/ 23 - unsigned int *row_gpios; 24 - unsigned int *col_gpios; 25 22 }; 26 23 27 24 /* Group (0..3) -- when multiple keys are pressed, only the