From: Tobias Klauser <tklauser@distanz.ch>
To: Jim Davis <jim.epost@gmail.com>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
linux-next <linux-next@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
jslaby@suse.cz, linux-serial@vger.kernel.org
Subject: [PATCH] tty: serial: serial_mctrl_gpio: Fix build error for !GPIOLIB
Date: Wed, 10 Sep 2014 10:06:58 +0200 [thread overview]
Message-ID: <20140910080657.GC14260@distanz.ch> (raw)
In-Reply-To: <CA+r1ZhjCZBWjkxjoJz=PO-YZg6LbghQV75tGnpiSOrHM9CaygA@mail.gmail.com>
If SERIAL_MCTRL_GPIO is selected but GPIOLIB is not, the noop functions
from serial_mctrl_gpio.h are pulled in. However, serial_mctrl_gpio.c is
still compiled, leading to function redefinition build errors. Since all
drivers that include serial_mctrl_gpio.h also depend on
SERIAL_MCTRL_GPIO, let it depend on GPIOLIB as well remove the noop
functions alltogether.
Reported-by: Jim Davis <jim.epost@gmail.com>
Signed-off-by: Tobias Klauser <tklauser@distanz.ch>
---
drivers/tty/serial/Kconfig | 1 +
drivers/tty/serial/serial_mctrl_gpio.h | 35 ----------------------------------
2 files changed, 1 insertion(+), 35 deletions(-)
diff --git a/drivers/tty/serial/Kconfig b/drivers/tty/serial/Kconfig
index 8079f52..5f1ea62 100644
--- a/drivers/tty/serial/Kconfig
+++ b/drivers/tty/serial/Kconfig
@@ -1575,5 +1575,6 @@ endmenu
config SERIAL_MCTRL_GPIO
tristate
+ select GPIOLIB
endif # TTY
diff --git a/drivers/tty/serial/serial_mctrl_gpio.h b/drivers/tty/serial/serial_mctrl_gpio.h
index 400ba04..5e4c96a 100644
--- a/drivers/tty/serial/serial_mctrl_gpio.h
+++ b/drivers/tty/serial/serial_mctrl_gpio.h
@@ -40,8 +40,6 @@ enum mctrl_gpio_idx {
*/
struct mctrl_gpios;
-#ifdef CONFIG_GPIOLIB
-
/*
* Set state of the modem control output lines via GPIOs.
*/
@@ -74,37 +72,4 @@ struct mctrl_gpios *mctrl_gpio_init(struct device *dev, unsigned int idx);
*/
void mctrl_gpio_free(struct device *dev, struct mctrl_gpios *gpios);
-#else /* GPIOLIB */
-
-static inline
-void mctrl_gpio_set(struct mctrl_gpios *gpios, unsigned int mctrl)
-{
-}
-
-static inline
-unsigned int mctrl_gpio_get(struct mctrl_gpios *gpios, unsigned int *mctrl)
-{
- return *mctrl;
-}
-
-static inline
-struct gpio_desc *mctrl_gpio_to_gpiod(struct mctrl_gpios *gpios,
- enum mctrl_gpio_idx gidx)
-{
- return ERR_PTR(-ENOSYS);
-}
-
-static inline
-struct mctrl_gpios *mctrl_gpio_init(struct device *dev, unsigned int idx)
-{
- return ERR_PTR(-ENOSYS);
-}
-
-static inline
-void mctrl_gpio_free(struct device *dev, struct mctrl_gpios *gpios)
-{
-}
-
-#endif /* GPIOLIB */
-
#endif
--
2.0.1
next prev parent reply other threads:[~2014-09-10 8:06 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-09 22:32 randconfig build error with next-20140909, in drivers/tty/serial/serial_mctrl_gpio.c Jim Davis
2014-09-10 8:05 ` Tobias Klauser
2014-09-10 8:06 ` Tobias Klauser [this message]
2014-09-10 13:57 ` [PATCH] tty: serial: serial_mctrl_gpio: Fix build error for !GPIOLIB Greg Kroah-Hartman
2014-09-10 14:16 ` Tobias Klauser
2014-09-10 14:36 ` Alexander Shiyan
2014-09-10 14:36 ` Alexander Shiyan
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140910080657.GC14260@distanz.ch \
--to=tklauser@distanz.ch \
--cc=gregkh@linuxfoundation.org \
--cc=jim.epost@gmail.com \
--cc=jslaby@suse.cz \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-next@vger.kernel.org \
--cc=linux-serial@vger.kernel.org \
--cc=sfr@canb.auug.org.au \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.