linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Laurent Vivier <laurent@vivier.eu>
To: linux-kernel@vger.kernel.org
Cc: Laurent Vivier <laurent@vivier.eu>,
	linux-m68k@lists.linux-m68k.org,
	Paul Mackerras <paulus@samba.org>,
	linux-serial@vger.kernel.org,
	Geert Uytterhoeven <geert@linux-m68k.org>,
	linuxppc-dev@lists.ozlabs.org, Joshua Thompson <funaho@jurai.org>
Subject: [PATCH] serial: pmac_zilog: don't init if zilog is not available
Date: Tue, 20 Oct 2020 18:23:03 +0200	[thread overview]
Message-ID: <20201020162303.1730562-1-laurent@vivier.eu> (raw)

We can avoid to probe for the Zilog device (and generate ugly kernel warning)
if kernel is built for Mac but not on a Mac.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
---
 drivers/tty/serial/pmac_zilog.c | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/drivers/tty/serial/pmac_zilog.c b/drivers/tty/serial/pmac_zilog.c
index 063484b22523..d1d2e55983c3 100644
--- a/drivers/tty/serial/pmac_zilog.c
+++ b/drivers/tty/serial/pmac_zilog.c
@@ -1867,6 +1867,12 @@ static struct platform_driver pmz_driver = {
 static int __init init_pmz(void)
 {
 	int rc, i;
+
+#ifdef CONFIG_MAC
+	if (!MACH_IS_MAC)
+		return -ENODEV;
+#endif
+
 	printk(KERN_INFO "%s\n", version);
 
 	/* 
@@ -2034,6 +2040,11 @@ static int __init pmz_console_setup(struct console *co, char *options)
 
 static int __init pmz_console_init(void)
 {
+#ifdef CONFIG_MAC
+	if (!MACH_IS_MAC)
+		return -ENODEV;
+#endif
+
 	/* Probe ports */
 	pmz_probe();
 
-- 
2.26.2


             reply	other threads:[~2020-10-20 16:32 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-20 16:23 Laurent Vivier [this message]
2020-10-20 16:28 ` [PATCH] serial: pmac_zilog: don't init if zilog is not available Greg KH
2020-10-20 16:37   ` Laurent Vivier
2020-10-20 17:37     ` Greg KH
2020-10-20 18:19       ` Laurent Vivier
2020-10-20 18:32         ` Greg KH
2020-10-20 18:42           ` Laurent Vivier
2020-10-20 22:44             ` Brad Boyer
2020-10-20 23:43               ` Finn Thain
2020-10-21  7:54                 ` Laurent Vivier
2020-10-22  3:23                   ` Finn Thain
2020-10-22  7:16                     ` Laurent Vivier
2020-10-22  7:26                     ` Geert Uytterhoeven
2020-10-23  3:21                       ` Finn Thain
2020-10-22  2:52             ` Michael Ellerman

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=20201020162303.1730562-1-laurent@vivier.eu \
    --to=laurent@vivier.eu \
    --cc=funaho@jurai.org \
    --cc=geert@linux-m68k.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=paulus@samba.org \
    /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 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).