lkml.org 
[lkml]   [2022]   [Sep]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH v1 11/17] pinctrl: cy8c95x0: Use 'default' in all switch-cases
Date
Move the default values to the 'default' case in the switches.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/pinctrl/pinctrl-cy8c95x0.c | 18 ++++++++++--------
1 file changed, 10 insertions(+), 8 deletions(-)

diff --git a/drivers/pinctrl/pinctrl-cy8c95x0.c b/drivers/pinctrl/pinctrl-cy8c95x0.c
index 55bd48c9d020..6fe442b44cab 100644
--- a/drivers/pinctrl/pinctrl-cy8c95x0.c
+++ b/drivers/pinctrl/pinctrl-cy8c95x0.c
@@ -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)
@@ -304,9 +304,9 @@ static bool cy8c95x0_volatile_register(struct device *dev, unsigned int reg)
case CY8C95X0_INPUT_(0) ... CY8C95X0_INPUT_(7):
case CY8C95X0_INTSTATUS_(0) ... CY8C95X0_INTSTATUS_(7):
return true;
+ default:
+ return false;
}
-
- return false;
}

static bool cy8c95x0_precious_register(struct device *dev, unsigned int reg)
@@ -314,9 +314,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[] = {
@@ -1244,6 +1244,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");
--
2.35.1
\
 
 \ /
  Last update: 2022-09-02 20:35    [W:0.111 / U:0.328 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site