All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sven Schnelle <svens@stackframe.org>
To: nicolas.ferre@atmel.com
Cc: svens@stackframe.org, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: [PATCH] tty/serial: atmel_serial: fix compilation
Date: Fri, 28 Oct 2011 13:33:51 +0200	[thread overview]
Message-ID: <1319801631-14654-1-git-send-email-svens@stackframe.org> (raw)

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


             reply	other threads:[~2011-10-28 11:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-28 11:33 Sven Schnelle [this message]
     [not found] ` <1319801631-14654-1-git-send-email-svens-yWSVVCS59A8YeIxN5WHPnw@public.gmane.org>
2011-10-28 12:38   ` [PATCH] tty/serial: atmel_serial: fix compilation Nicolas Ferre
2011-10-28 12:38     ` Nicolas Ferre
2011-10-28 13:18     ` Greg KH
     [not found]       ` <20111028131811.GA25743-l3A5Bk7waGM@public.gmane.org>
2011-10-29 11:49         ` Grant Likely
2011-10-29 11:49           ` Grant Likely

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=1319801631-14654-1-git-send-email-svens@stackframe.org \
    --to=svens@stackframe.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=nicolas.ferre@atmel.com \
    /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.