]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
pinctrl: cy8c95x0: Remove redundant check in cy8c95x0_regmap_update_bits_base()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 5 Feb 2025 09:51:14 +0000 (11:51 +0200)
committerLinus Walleij <linus.walleij@linaro.org>
Sun, 16 Feb 2025 23:17:25 +0000 (00:17 +0100)
The function is never called with the PORTSEL register in the argument.
Drop unneeded check, but rescue a comment. While at it, drop inline
and allow any compiler to choose better stragy (note, that inline in
C code is only a recomendation to most of the modern compilers anyway).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/20250205095243.512292-5-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-cy8c95x0.c

index 0d732e7a0868bad533d4db0c91bf2b4ee9806867..04b534b950d001f3d5215468a237361038331082 100644 (file)
@@ -477,20 +477,14 @@ static const struct regmap_config cy8c9520_i2c_regmap = {
 #endif
 };
 
-static inline int cy8c95x0_regmap_update_bits_base(struct cy8c95x0_pinctrl *chip,
-                                                  unsigned int reg,
-                                                  unsigned int port,
-                                                  unsigned int mask,
-                                                  unsigned int val,
-                                                  bool *change, bool async,
-                                                  bool force)
+/* Caller should never modify PORTSEL directly */
+static int cy8c95x0_regmap_update_bits_base(struct cy8c95x0_pinctrl *chip,
+                                           unsigned int reg, unsigned int port,
+                                           unsigned int mask, unsigned int val,
+                                           bool *change, bool async, bool force)
 {
        int ret, off, i;
 
-       /* Caller should never modify PORTSEL directly */
-       if (reg == CY8C95X0_PORTSEL)
-               return -EINVAL;
-
        /* Registers behind the PORTSEL mux have their own range in regmap */
        if (cy8c95x0_muxed_register(reg)) {
                off = CY8C95X0_MUX_REGMAP_TO_OFFSET(reg, port);