Skip to contentSkip to conversation

gpio: fix build failure: gpiochip_[un]lock*() static/non-static

PATCH In review John Hubbard 2 participants 3 messages Sep 7, 2019 – Sep 10, 2019

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

PATCH 1/1 gpio: fix build failure: gpiochip_[un]lock*() static/non-static

While building with !CONFIG_GPIOLIB, I experienced a build failure, because driver.h in that configuration supplies both a static and a non-static version of these routines:

gpiochip_lock_as_irq()
gpiochip_unlock_as_irq()

Fix this by moving the non-static routines under the scope of CONFIG_GPIOLIB.

Fixes commit c7663fa2a663 ("gpio: Move gpiochip_lock/unlock_as_irq to gpio/driver.h")
Cc YueHaibing <[email protected]>
Cc Linus Walleij <[email protected]>

---

Hi,

This is for today's linux-next.

More background:

It *looks* like the original commit did correctly put the non-static versions of these routines in CONFIG_GPIOLIB, and the static versions inside !CONFIG_GPIOLIB, but my git history foo is not strong enough to figure out how we got here, so I'm not sure if the "Fixes:" tag really refers to the guilty commit.

thanks,
John Hubbard
NVIDIA

 include/linux/gpio/driver.h | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
include/linux/gpio/driver.h +2 -4
index b74a3bee85e5..39be896aad38 100644
@@ -702,13 +702,11 @@ void gpiochip_free_own_desc(struct gpio_desc *desc);
 void devprop_gpiochip_set_names(struct gpio_chip *chip,
 				const struct fwnode_handle *fwnode);
 
-/* lock/unlock as IRQ */
-int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
-void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
-
 #ifdef CONFIG_GPIOLIB
 
 struct gpio_chip *gpiod_to_chip(const struct gpio_desc *desc);
+int gpiochip_lock_as_irq(struct gpio_chip *chip, unsigned int offset);
+void gpiochip_unlock_as_irq(struct gpio_chip *chip, unsigned int offset);
 
 #else /* CONFIG_GPIOLIB */
 
Signature · 1 line
2.23.0
#1 lore raw
Quoted 3 lines · John Hubbard

While building with !CONFIG_GPIOLIB, I experienced a build failure, because driver.h in that configuration supplies both a static and a non-static version of these routines:

I think this is fixed in my latest version of the "devel" branch?

Yours,
Linus Walleij

#2 lore raw
Quoted 8 lines · Linus Walleij
Quoted 3 lines · John Hubbard

While building with !CONFIG_GPIOLIB, I experienced a build failure, because driver.h in that configuration supplies both a static and a non-static version of these routines:

I think this is fixed in my latest version of the "devel" branch?

OK, sounds good to me. Sorry for not spotting that a fix is in the pipeline. :)

thanks,

Signature · 2 lines
John Hubbard
NVIDIA