Skip to contentSkip to conversation

ssb: gpio: use #if instead of "if" for IS_ENABLED

PATCH New Rafał Miłecki 1 participant 1 message Jan 14, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 ssb: gpio: use #if instead of "if" for IS_ENABLED

Standard "if" was evaluating to if (0) which still required conditional code to be correct. It is not, as ssb_gpio_to_irq is not defined.

---
John: if you manage to, you should merge (bundle?) this one with
ssb: gpio: add own IRQ domain
(to avoid build breakage during bisection)

---
 drivers/ssb/driver_gpio.c |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
drivers/ssb/driver_gpio.c +6 -4
index 6c5a97d..ba350d2 100644
@@ -230,8 +230,9 @@ static int ssb_gpio_chipco_init(struct ssb_bus *bus)
 	chip->set		= ssb_gpio_chipco_set_value;
 	chip->direction_input	= ssb_gpio_chipco_direction_input;
 	chip->direction_output	= ssb_gpio_chipco_direction_output;
-	if (IS_ENABLED(CONFIG_SSB_EMBEDDED))
-		chip->to_irq	= ssb_gpio_to_irq;
+#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
+	chip->to_irq		= ssb_gpio_to_irq;
+#endif
 	chip->ngpio		= 16;
 	/* There is just one SoC in one device and its GPIO addresses should be
 	 * deterministic to address them more easily. The other buses could get
@@ -422,8 +423,9 @@ static int ssb_gpio_extif_init(struct ssb_bus *bus)
 	chip->set		= ssb_gpio_extif_set_value;
 	chip->direction_input	= ssb_gpio_extif_direction_input;
 	chip->direction_output	= ssb_gpio_extif_direction_output;
-	if (IS_ENABLED(CONFIG_SSB_EMBEDDED))
-		chip->to_irq	= ssb_gpio_to_irq;
+#if IS_ENABLED(CONFIG_SSB_EMBEDDED)
+	chip->to_irq		= ssb_gpio_to_irq;
+#endif
 	chip->ngpio		= 5;
 	/* There is just one SoC in one device and its GPIO addresses should be
 	 * deterministic to address them more easily. The other buses could get
Signature · 1 line
1.7.10.4