* [PATCH] tty/serial: atmel_serial: fix compilation
@ 2011-10-28 11:33 Sven Schnelle
2011-10-28 12:38 ` Nicolas Ferre
0 siblings, 1 reply; 4+ messages in thread
From: Sven Schnelle @ 2011-10-28 11:33 UTC (permalink / raw)
To: nicolas.ferre; +Cc: svens, linux-serial, linux-kernel
If CONFIG_OF is disabled, compilation fails with:
drivers/tty/serial/atmel_serial.c: In function 'atmel_serial_probe':
drivers/tty/serial/atmel_serial.c:1788: error: implicit declaration of function 'of_alias_get_id'
Fix this by adding the proper CONFIG_OF checks.
Signed-off-by: Sven Schnelle <svens@stackframe.org>
---
drivers/tty/serial/atmel_serial.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
index 4a0f86f..de338dd 100644
--- a/drivers/tty/serial/atmel_serial.c
+++ b/drivers/tty/serial/atmel_serial.c
@@ -1777,16 +1777,20 @@ static int atmel_serial_resume(struct platform_device *pdev)
static int __devinit atmel_serial_probe(struct platform_device *pdev)
{
struct atmel_uart_port *port;
+#ifdef CONFIG_OF
struct device_node *np = pdev->dev.of_node;
+#endif
struct atmel_uart_data *pdata = pdev->dev.platform_data;
void *data;
int ret = -ENODEV;
BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
+#ifdef CONFIG_OF
if (np)
ret = of_alias_get_id(np, "serial");
else
+#endif
if (pdata)
ret = pdata->num;
--
1.7.6.3
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] tty/serial: atmel_serial: fix compilation
2011-10-28 11:33 [PATCH] tty/serial: atmel_serial: fix compilation Sven Schnelle
@ 2011-10-28 12:38 ` Nicolas Ferre
2011-10-28 13:18 ` Greg KH
0 siblings, 1 reply; 4+ messages in thread
From: Nicolas Ferre @ 2011-10-28 12:38 UTC (permalink / raw)
To: Sven Schnelle, Grant Likely, devicetree-discuss, Rob Herring,
Greg Kroah-Hartman
Cc: linux-serial, linux-kernel
On 10/28/2011 01:33 PM, Sven Schnelle :
> If CONFIG_OF is disabled, compilation fails with:
>
> drivers/tty/serial/atmel_serial.c: In function 'atmel_serial_probe':
> drivers/tty/serial/atmel_serial.c:1788: error: implicit declaration of function 'of_alias_get_id'
>
> Fix this by adding the proper CONFIG_OF checks.
Yes, but I would like to avoid this and I have made a patch to address
this issue. I have sent it to the device tree guys yesterday:
"[PATCH] dt: add empty of_alias_get_id() for non-dt builds"
Maybe we can wait a little and see if it reaches Linus' tree on time. If
it is not, I will make sure that such a fix make it to mainline.
Best regards,
> Signed-off-by: Sven Schnelle <svens@stackframe.org>
> ---
> drivers/tty/serial/atmel_serial.c | 4 ++++
> 1 files changed, 4 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/tty/serial/atmel_serial.c b/drivers/tty/serial/atmel_serial.c
> index 4a0f86f..de338dd 100644
> --- a/drivers/tty/serial/atmel_serial.c
> +++ b/drivers/tty/serial/atmel_serial.c
> @@ -1777,16 +1777,20 @@ static int atmel_serial_resume(struct platform_device *pdev)
> static int __devinit atmel_serial_probe(struct platform_device *pdev)
> {
> struct atmel_uart_port *port;
> +#ifdef CONFIG_OF
> struct device_node *np = pdev->dev.of_node;
> +#endif
> struct atmel_uart_data *pdata = pdev->dev.platform_data;
> void *data;
> int ret = -ENODEV;
>
> BUILD_BUG_ON(ATMEL_SERIAL_RINGSIZE & (ATMEL_SERIAL_RINGSIZE - 1));
>
> +#ifdef CONFIG_OF
> if (np)
> ret = of_alias_get_id(np, "serial");
> else
> +#endif
> if (pdata)
> ret = pdata->num;
>
--
Nicolas Ferre
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tty/serial: atmel_serial: fix compilation
2011-10-28 12:38 ` Nicolas Ferre
@ 2011-10-28 13:18 ` Greg KH
2011-10-29 11:49 ` Grant Likely
0 siblings, 1 reply; 4+ messages in thread
From: Greg KH @ 2011-10-28 13:18 UTC (permalink / raw)
To: Nicolas Ferre
Cc: Sven Schnelle, Grant Likely, devicetree-discuss, Rob Herring,
linux-serial, linux-kernel
On Fri, Oct 28, 2011 at 02:38:09PM +0200, Nicolas Ferre wrote:
> On 10/28/2011 01:33 PM, Sven Schnelle :
> > If CONFIG_OF is disabled, compilation fails with:
> >
> > drivers/tty/serial/atmel_serial.c: In function 'atmel_serial_probe':
> > drivers/tty/serial/atmel_serial.c:1788: error: implicit declaration of function 'of_alias_get_id'
> >
> > Fix this by adding the proper CONFIG_OF checks.
>
> Yes, but I would like to avoid this and I have made a patch to address
> this issue. I have sent it to the device tree guys yesterday:
> "[PATCH] dt: add empty of_alias_get_id() for non-dt builds"
>
> Maybe we can wait a little and see if it reaches Linus' tree on time. If
> it is not, I will make sure that such a fix make it to mainline.
I agree, the other dt: patch is the correct way to fix this, not this
driver-only #ifdef hack.
thanks,
greg k-h
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] tty/serial: atmel_serial: fix compilation
2011-10-28 13:18 ` Greg KH
@ 2011-10-29 11:49 ` Grant Likely
0 siblings, 0 replies; 4+ messages in thread
From: Grant Likely @ 2011-10-29 11:49 UTC (permalink / raw)
To: Greg KH
Cc: Nicolas Ferre, Sven Schnelle, devicetree-discuss, Rob Herring,
linux-serial, linux-kernel
On Fri, Oct 28, 2011 at 03:18:11PM +0200, Greg KH wrote:
> On Fri, Oct 28, 2011 at 02:38:09PM +0200, Nicolas Ferre wrote:
> > On 10/28/2011 01:33 PM, Sven Schnelle :
> > > If CONFIG_OF is disabled, compilation fails with:
> > >
> > > drivers/tty/serial/atmel_serial.c: In function 'atmel_serial_probe':
> > > drivers/tty/serial/atmel_serial.c:1788: error: implicit declaration of function 'of_alias_get_id'
> > >
> > > Fix this by adding the proper CONFIG_OF checks.
> >
> > Yes, but I would like to avoid this and I have made a patch to address
> > this issue. I have sent it to the device tree guys yesterday:
> > "[PATCH] dt: add empty of_alias_get_id() for non-dt builds"
> >
> > Maybe we can wait a little and see if it reaches Linus' tree on time. If
> > it is not, I will make sure that such a fix make it to mainline.
>
> I agree, the other dt: patch is the correct way to fix this, not this
> driver-only #ifdef hack.
I've picked up the of_alias_get_id patch now.
g.
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2011-10-29 23:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-28 11:33 [PATCH] tty/serial: atmel_serial: fix compilation Sven Schnelle
2011-10-28 12:38 ` Nicolas Ferre
2011-10-28 13:18 ` Greg KH
2011-10-29 11:49 ` Grant Likely
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).