From: Bartosz Golaszewski Date: Wed, 23 Apr 2025 07:15:03 +0000 (+0200) Subject: gpio: imx-scu: don't check the GPIO range X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=57bbc60be45b750073acc7d94aaccc4e652319a1;p=linux.git gpio: imx-scu: don't check the GPIO range Core GPIO code already does this for drivers, no need to duplicate the check. Reviewed-by: Peng Fan Reviewed-by: Linus Walleij Link: https://lore.kernel.org/r/20250423-gpiochip-set-rv-gpio-part2-v1-1-b22245cde81a@linaro.org Signed-off-by: Bartosz Golaszewski --- diff --git a/drivers/gpio/gpio-imx-scu.c b/drivers/gpio/gpio-imx-scu.c index 13baf465aedf..403d03f18122 100644 --- a/drivers/gpio/gpio-imx-scu.c +++ b/drivers/gpio/gpio-imx-scu.c @@ -37,9 +37,6 @@ static int imx_scu_gpio_get(struct gpio_chip *chip, unsigned int offset) int level; int err; - if (offset >= chip->ngpio) - return -EINVAL; - mutex_lock(&priv->lock); /* to read PIN state via scu api */ @@ -60,9 +57,6 @@ static void imx_scu_gpio_set(struct gpio_chip *chip, unsigned int offset, int va struct scu_gpio_priv *priv = gpiochip_get_data(chip); int err; - if (offset >= chip->ngpio) - return; - mutex_lock(&priv->lock); /* to set PIN output level via scu api */ @@ -77,9 +71,6 @@ static void imx_scu_gpio_set(struct gpio_chip *chip, unsigned int offset, int va static int imx_scu_gpio_get_direction(struct gpio_chip *chip, unsigned int offset) { - if (offset >= chip->ngpio) - return -EINVAL; - return GPIO_LINE_DIRECTION_OUT; }