linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] serial: pmac_zilog: don't init if zilog is not available
@ 2020-10-20 16:23 Laurent Vivier
  2020-10-20 16:28 ` Greg KH
  0 siblings, 1 reply; 15+ messages in thread
From: Laurent Vivier @ 2020-10-20 16:23 UTC (permalink / raw)
  To: linux-kernel
  Cc: Laurent Vivier, linux-m68k, Paul Mackerras, linux-serial,
	Geert Uytterhoeven, linuxppc-dev, Joshua Thompson

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


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-10-23  3:22 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-10-20 16:23 [PATCH] serial: pmac_zilog: don't init if zilog is not available Laurent Vivier
2020-10-20 16:28 ` 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

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).