pinctrl: cy8c95x0: Use 'default' in all switch-cases
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Fri, 2 Sep 2022 18:26:44 +0000 (21:26 +0300)
committerLinus Walleij <linus.walleij@linaro.org>
Thu, 8 Sep 2022 08:05:58 +0000 (10:05 +0200)
Move the default values to the 'default' case in the switches.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Tested-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Link: https://lore.kernel.org/r/20220902182650.83098-11-andriy.shevchenko@linux.intel.com
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
drivers/pinctrl/pinctrl-cy8c95x0.c

index 204a53d..c714c43 100644 (file)
@@ -279,9 +279,9 @@ static bool cy8c95x0_readable_register(struct device *dev, unsigned int reg)
        switch (reg) {
        case 0x24 ... 0x27:
                return false;
+       default:
+               return true;
        }
-
-       return true;
 }
 
 static bool cy8c95x0_writeable_register(struct device *dev, unsigned int reg)
@@ -293,9 +293,9 @@ static bool cy8c95x0_writeable_register(struct device *dev, unsigned int reg)
                return false;
        case 0x24 ... 0x27:
                return false;
+       default:
+               return true;
        }
-
-       return true;
 }
 
 static bool cy8c95x0_volatile_register(struct device *dev, unsigned int reg)
@@ -325,9 +325,9 @@ static bool cy8c95x0_precious_register(struct device *dev, unsigned int reg)
        switch (reg) {
        case CY8C95X0_INTSTATUS_(0) ... CY8C95X0_INTSTATUS_(7):
                return true;
+       default:
+               return false;
        }
-
-       return false;
 }
 
 static const struct reg_default cy8c95x0_reg_defaults[] = {
@@ -1255,6 +1255,8 @@ static int cy8c95x0_probe(struct i2c_client *client)
        case 60:
                strscpy(chip->name, cy8c95x0_id[2].name, I2C_NAME_SIZE);
                break;
+       default:
+               return -ENODEV;
        }
 
        reg = devm_regulator_get(&client->dev, "vdd");