Skip to content

Commit e034e05

Browse files
author
Bartosz Golaszewski
committed
gpio: line-mux: remove bits already handled by GPIO core
GPIO core already handles checking the offset against the number of GPIOs as well as missing any of the GPIO chip callbacks. Remove the unnecessary bits. Also, the offset check was off-by-one as reported by Dan. Fixes: 2b03d9a ("gpio: add gpio-line-mux driver") Reported-by: Dan Carpenter <dan.carpenter@linaro.org> Closes: https://lore.kernel.org/all/aV4b6GAGz1zyf8Xy@stanley.mountain/ Tested-by: Jonas Jelonek <jelonek.jonas@gmail.com> Reviewed-by: Jonas Jelonek <jelonek.jonas@gmail.com> Link: https://lore.kernel.org/r/20260107085833.17338-1-bartosz.golaszewski@oss.qualcomm.com Signed-off-by: Bartosz Golaszewski <bartosz.golaszewski@oss.qualcomm.com>
1 parent 8ba3798 commit e034e05

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

drivers/gpio/gpio-line-mux.c

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,6 @@ static int gpio_lmux_gpio_get(struct gpio_chip *gc, unsigned int offset)
2929
struct gpio_lmux *glm = gpiochip_get_data(gc);
3030
int ret;
3131

32-
if (offset > gc->ngpio)
33-
return -EINVAL;
34-
3532
ret = mux_control_select_delay(glm->mux, glm->gpio_mux_states[offset],
3633
MUX_SELECT_DELAY_US);
3734
if (ret < 0)
@@ -42,12 +39,6 @@ static int gpio_lmux_gpio_get(struct gpio_chip *gc, unsigned int offset)
4239
return ret;
4340
}
4441

45-
static int gpio_lmux_gpio_set(struct gpio_chip *gc, unsigned int offset,
46-
int value)
47-
{
48-
return -EOPNOTSUPP;
49-
}
50-
5142
static int gpio_lmux_gpio_get_direction(struct gpio_chip *gc,
5243
unsigned int offset)
5344
{
@@ -80,7 +71,6 @@ static int gpio_lmux_probe(struct platform_device *pdev)
8071
glm->gc.parent = dev;
8172

8273
glm->gc.get = gpio_lmux_gpio_get;
83-
glm->gc.set = gpio_lmux_gpio_set;
8474
glm->gc.get_direction = gpio_lmux_gpio_get_direction;
8575

8676
glm->mux = devm_mux_control_get(dev, NULL);

0 commit comments

Comments
 (0)