Skip to contentSkip to conversation

tty/serial: atmel_serial: fix compilation

PATCH In review Sven Schnelle 4 participants 4 messages Oct 28, 2011 – Oct 29, 2011

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

PATCH 1/1 tty/serial: atmel_serial: fix compilation

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.

---
 drivers/tty/serial/atmel_serial.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/tty/serial/atmel_serial.c +4 -0
index 4a0f86f..de338dd 100644
@@ -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;
 
Signature · 1 line
1.7.6.3
#1 lore raw

On 10/28/2011 01:33 PM, Sven Schnelle :

Quoted 6 lines

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,

Quoted 30 lines
---
 drivers/tty/serial/atmel_serial.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/tty/serial/atmel_serial.c +4 -0
index 4a0f86f..de338dd 100644
@@ -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;
 
Signature · 1 line
Nicolas Ferre
#2 lore raw
Quoted 6 lines · Nicolas Ferre

On 10/28/2011 01:33 PM, Sven Schnelle :

Quoted 5 lines

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'

Quoted 8 lines
Quoted 1 line

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

#3 lore raw
Quoted 13 lines · Greg KH
Quoted 12 lines · Nicolas Ferre

On 10/28/2011 01:33 PM, Sven Schnelle :

Quoted 6 lines

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"

Quoted 5 lines
Quoted 2 lines

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.