diff mbox series

[02/10] tty: serial: samsung_tty: fix build warning

Message ID 20191210143706.3928480-2-gregkh@linuxfoundation.org (mailing list archive)
State Not Applicable
Headers show
Series [01/10] tty: serial: samsung: allow driver to be built by anyone | expand

Commit Message

Greg Kroah-Hartman Dec. 10, 2019, 2:36 p.m. UTC
Fix a build warning on systems that do not have CONFIG_OF enabled.

Cc: Kukjin Kim <kgene@kernel.org>
Cc: Krzysztof Kozlowski <krzk@kernel.org>
Cc: Hyunki Koo <kkoos00@naver.com>
Cc: HYUN-KI KOO <hyunki00.koo@samsung.com>
Cc: Shinbeom Choi <sbeom.choi@samsung.com>
Cc: Jiri Slaby <jslaby@suse.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-samsung-soc@vger.kernel.org
Cc: linux-serial@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
---
 drivers/tty/serial/samsung_tty.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Krzysztof Kozlowski Dec. 10, 2019, 2:48 p.m. UTC | #1
On Tue, Dec 10, 2019 at 03:36:58PM +0100, Greg Kroah-Hartman wrote:
> Fix a build warning on systems that do not have CONFIG_OF enabled.
> 

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof
Enrico Weigelt, metux IT consult Dec. 11, 2019, 11:01 a.m. UTC | #2
On 10.12.19 15:36, Greg Kroah-Hartman wrote:

Hi,

> diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> index 83fd51607741..67c5a84d0a26 100644
> --- a/drivers/tty/serial/samsung_tty.c
> +++ b/drivers/tty/serial/samsung_tty.c
> @@ -1851,7 +1851,10 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
>  
>  /* Device driver serial port probe */
>  
> +#ifdef CONFIG_OF
>  static const struct of_device_id s3c24xx_uart_dt_match[];
> +#endif
> +

By the way: I've got some patch for conditionally declaring of match
tables (including MODULE_DEVICE_TABE() call), so such ifdef's aren't
needed anymore.

Would you like to see it ?
(IIRC already posted it quite some time ago, but probably went
unnoticed)


--mtx

---
Enrico Weigelt, metux IT consult
Free software and Linux embedded engineering
info@metux.net -- +49-151-27565287
Greg Kroah-Hartman Dec. 11, 2019, 12:13 p.m. UTC | #3
On Wed, Dec 11, 2019 at 12:01:28PM +0100, Enrico Weigelt, metux IT consult wrote:
> On 10.12.19 15:36, Greg Kroah-Hartman wrote:
> 
> Hi,
> 
> > diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
> > index 83fd51607741..67c5a84d0a26 100644
> > --- a/drivers/tty/serial/samsung_tty.c
> > +++ b/drivers/tty/serial/samsung_tty.c
> > @@ -1851,7 +1851,10 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
> >  
> >  /* Device driver serial port probe */
> >  
> > +#ifdef CONFIG_OF
> >  static const struct of_device_id s3c24xx_uart_dt_match[];
> > +#endif
> > +
> 
> By the way: I've got some patch for conditionally declaring of match
> tables (including MODULE_DEVICE_TABE() call), so such ifdef's aren't
> needed anymore.

That's not why this #ifdef is needed.

greg k-h
diff mbox series

Patch

diff --git a/drivers/tty/serial/samsung_tty.c b/drivers/tty/serial/samsung_tty.c
index 83fd51607741..67c5a84d0a26 100644
--- a/drivers/tty/serial/samsung_tty.c
+++ b/drivers/tty/serial/samsung_tty.c
@@ -1851,7 +1851,10 @@  static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
 
 /* Device driver serial port probe */
 
+#ifdef CONFIG_OF
 static const struct of_device_id s3c24xx_uart_dt_match[];
+#endif
+
 static int probe_index;
 
 static inline struct s3c24xx_serial_drv_data *s3c24xx_get_driver_data(