linux-next.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] gpio: fix build failure: gpiochip_[un]lock*() static/non-static
@ 2019-09-07  1:05 John Hubbard
  2019-09-07 23:16 ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: John Hubbard @ 2019-09-07  1:05 UTC (permalink / raw)
  To: YueHaibing
  Cc: Bartosz Golaszewski, linux-gpio, Linux Next Mailing List, LKML,
	John Hubbard, Linus Walleij

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 <yuehaibing@huawei.com>
Cc: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---

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(-)

diff --git a/include/linux/gpio/driver.h b/include/linux/gpio/driver.h
index b74a3bee85e5..39be896aad38 100644
--- a/include/linux/gpio/driver.h
+++ b/include/linux/gpio/driver.h
@@ -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 */
 
-- 
2.23.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: fix build failure: gpiochip_[un]lock*() static/non-static
  2019-09-07  1:05 [PATCH] gpio: fix build failure: gpiochip_[un]lock*() static/non-static John Hubbard
@ 2019-09-07 23:16 ` Linus Walleij
  2019-09-10 23:39   ` John Hubbard
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2019-09-07 23:16 UTC (permalink / raw)
  To: John Hubbard
  Cc: YueHaibing, Bartosz Golaszewski, open list:GPIO SUBSYSTEM,
	Linux Next Mailing List, LKML

On Sat, Sep 7, 2019 at 2:05 AM John Hubbard <jhubbard@nvidia.com> wrote:

> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gpio: fix build failure: gpiochip_[un]lock*() static/non-static
  2019-09-07 23:16 ` Linus Walleij
@ 2019-09-10 23:39   ` John Hubbard
  0 siblings, 0 replies; 3+ messages in thread
From: John Hubbard @ 2019-09-10 23:39 UTC (permalink / raw)
  To: Linus Walleij
  Cc: YueHaibing, Bartosz Golaszewski, open list:GPIO SUBSYSTEM,
	Linux Next Mailing List, LKML

On 9/8/19 12:16 AM, Linus Walleij wrote:
> On Sat, Sep 7, 2019 at 2:05 AM John Hubbard <jhubbard@nvidia.com> wrote:
> 
>> 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,
-- 
John Hubbard
NVIDIA

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-09-10 23:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-07  1:05 [PATCH] gpio: fix build failure: gpiochip_[un]lock*() static/non-static John Hubbard
2019-09-07 23:16 ` Linus Walleij
2019-09-10 23:39   ` John Hubbard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).