[v1] pinctrl: cherryview: reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case

Message ID 20231011064533.20549-1-raag.jadav@intel.com
State New
Headers
Series [v1] pinctrl: cherryview: reduce scope of PIN_CONFIG_BIAS_HIGH_IMPEDANCE case |

Commit Message

Raag Jadav Oct. 11, 2023, 6:45 a.m. UTC
  We have a couple of pinconfig cases inside the braces which are meant for
PIN_CONFIG_BIAS_HIGH_IMPEDANCE case. Although it is valid C, it makes the
code less readable and prone to misinterpretation. Limit the braces to
PIN_CONFIG_BIAS_HIGH_IMPEDANCE case to avoid this.

Signed-off-by: Raag Jadav <raag.jadav@intel.com>
Acked-by: Mika Westerberg <mika.westerberg@linux.intel.com>
---
 drivers/pinctrl/intel/pinctrl-cherryview.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)


base-commit: 55176feaa4d8f7d07005c6199d7843bc2991773d
  

Comments

Andy Shevchenko Oct. 11, 2023, 10:28 a.m. UTC | #1
On Wed, Oct 11, 2023 at 12:15:33PM +0530, Raag Jadav wrote:
> We have a couple of pinconfig cases inside the braces which are meant for
> PIN_CONFIG_BIAS_HIGH_IMPEDANCE case. Although it is valid C, it makes the
> code less readable and prone to misinterpretation. Limit the braces to
> PIN_CONFIG_BIAS_HIGH_IMPEDANCE case to avoid this.

Pushed to my review and testing queue, thanks!
  

Patch

diff --git a/drivers/pinctrl/intel/pinctrl-cherryview.c b/drivers/pinctrl/intel/pinctrl-cherryview.c
index 5fde4fec59c1..b1d8f6136f99 100644
--- a/drivers/pinctrl/intel/pinctrl-cherryview.c
+++ b/drivers/pinctrl/intel/pinctrl-cherryview.c
@@ -894,6 +894,7 @@  static int chv_config_get(struct pinctrl_dev *pctldev, unsigned int pin,
 			return -EINVAL;
 
 		break;
+	}
 
 	case PIN_CONFIG_DRIVE_PUSH_PULL:
 		if (ctrl1 & CHV_PADCTRL1_ODEN)
@@ -904,7 +905,6 @@  static int chv_config_get(struct pinctrl_dev *pctldev, unsigned int pin,
 		if (!(ctrl1 & CHV_PADCTRL1_ODEN))
 			return -EINVAL;
 		break;
-	}
 
 	default:
 		return -ENOTSUPP;