lkml.org 
[lkml]   [2020]   [Oct]   [20]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] serial: pmac_zilog: don't init if zilog is not available
Date
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
\
 
 \ /
  Last update: 2020-10-20 18:23    [W:2.421 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site