[PATCH v1 3/4] pinctrl: intel: Convert revision conditional to switch-case

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



switch-case is slightly better to maintain in case some new features will come
in new revisions of the hardware.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
---
 drivers/pinctrl/intel/pinctrl-intel.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/pinctrl/intel/pinctrl-intel.c b/drivers/pinctrl/intel/pinctrl-intel.c
index 1a479112ed85..00979acb0203 100644
--- a/drivers/pinctrl/intel/pinctrl-intel.c
+++ b/drivers/pinctrl/intel/pinctrl-intel.c
@@ -1483,9 +1483,13 @@ static int intel_pinctrl_probe(struct platform_device *pdev,
 
 		/* Determine community features based on the revision */
 		value = readl(regs + REVID);
-		if (((value & REVID_MASK) >> REVID_SHIFT) >= 0x94) {
+		switch ((value & REVID_MASK) >> REVID_SHIFT) {
+		case 0x0094 ... 0xffff:
 			community->features |= PINCTRL_FEATURE_DEBOUNCE;
 			community->features |= PINCTRL_FEATURE_1K_PD;
+			break;
+		default:
+			break;
 		}
 
 		/* Read offset of the pad configuration registers */
-- 
2.29.2




[Index of Archives]     [Linux SPI]     [Linux Kernel]     [Linux ARM (vger)]     [Linux ARM MSM]     [Linux Omap]     [Linux Arm]     [Linux Tegra]     [Fedora ARM]     [Linux for Samsung SOC]     [eCos]     [Linux Fastboot]     [Gcc Help]     [Git]     [DCCP]     [IETF Announce]     [Security]     [Linux MIPS]     [Yosemite Campsites]

  Powered by Linux