[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220902182650.83098-9-andriy.shevchenko@linux.intel.com>
Date: Fri, 2 Sep 2022 21:26:42 +0300
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: Linus Walleij <linus.walleij@...aro.org>,
Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Patrick Rudolph <patrick.rudolph@...ements.com>,
linux-gpio@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH v1 09/17] pinctrl: cy8c95x0: Remove useless conditionals
The pin control framework checks pin boundaries before calling
the respective driver's callbacks. Hence no need to check for
pin boundaries, the respective conditionals won't be ever true.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
---
drivers/pinctrl/pinctrl-cy8c95x0.c | 14 --------------
1 file changed, 14 deletions(-)
diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c
index b09f9485e57d..97da22016cce 100644
--- a/drivers/pinctrl/pinctrl-cy8c95x0.c
+++ b/drivers/pinctrl/pinctrl-cy8c95x0.c
@@ -1029,14 +1029,6 @@ static int cy8c95x0_pinctrl_get_group_pins(struct pinctrl_dev *pctldev,
const unsigned int **pins,
unsigned int *num_pins)
{
- struct cy8c95x0_pinctrl *chip = pinctrl_dev_get_drvdata(pctldev);
-
- if (group >= chip->tpin) {
- *pins = NULL;
- *num_pins = 0;
- return 0;
- }
-
*pins = &cy8c9560_pins[group].number;
*num_pins = 1;
return 0;
@@ -1104,9 +1096,6 @@ static int cy8c95x0_set_mux(struct pinctrl_dev *pctldev, unsigned int selector,
{
struct cy8c95x0_pinctrl *chip = pinctrl_dev_get_drvdata(pctldev);
- if (group >= chip->tpin)
- return -EINVAL;
-
return cy8c95x0_pinmux_cfg(chip, selector, group);
}
@@ -1133,9 +1122,6 @@ static int cy8c95x0_pinconf_set(struct pinctrl_dev *pctldev, unsigned int pin,
int ret = 0;
int i;
- if (WARN_ON(pin >= chip->tpin))
- return -EINVAL;
-
for (i = 0; i < num_configs; i++) {
ret = cy8c95x0_gpio_set_pincfg(chip, pin, configs[i]);
if (ret)
--
2.35.1
Powered by blists - more mailing lists