Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4589894pxu; Tue, 20 Oct 2020 23:32:59 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0+JDLZZAmnnol9cU3Zwe8e91d75WjNuoqIiB2reNUlndVbwfXmlZFpu9KH7CP/vsguMVt X-Received: by 2002:a17:906:4dc3:: with SMTP id f3mr2066467ejw.50.1603261978730; Tue, 20 Oct 2020 23:32:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603261978; cv=none; d=google.com; s=arc-20160816; b=aQO+dTAM9dP2RxvDEfDdLzGJGrgIPjFqG/skPbVW1CjyVqCZIqfAe9lQu9KMxnD9Sd inbM8bZ8Mxy82YgvmRQFmNERKdxmHbuJCCZcF4QNy8n0zZzb/MOQLF0VHtPHkYTGa71x qFlPI83hxff0Qy0Q/h0JEGkQtDGLxg1MOFKCgAGI3j4J9Dd/I8YCPlCQFztb+eQa5Trl lnBNuWMah+biY9iXHQORKr4Y/nj2oFoh878Otumc8S0yBIZdJ/H1e4nNsC2u+yYR1JF2 x4Uf24b5BIg+HKE8Rdk+ysgQRrHtcDJ3rz1kweNR+p8yST+zjwlTt3nnLC8AmH6ThcYL rQ+Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=f4pX3+7tvE6Z2sOo1qFEvr95n3k+Bgfcd+wItiG+bR4=; b=HYrJUuWDoJcyLtLDt/IiaTO+I1LSw5Nh0a9Ctr90et42T2vy8HSdvz4XzeftM7D3Wx iL+nz6C4elxpnvd2HZFxEyQk/QOUbtESXVvShKNnNYeGAapyEP2mcaj/042l1dncU64o IjmNL0Xg133KKyifW2INYQxU7LUVp/JD0l2NtNZesI4t4tgq5weNARiPO4qn86nclgO2 PSfkfQNibfkOqlfe9zQHnVnJGziu9R2M/AzGaqviBano6YmCA4dmu/wqlnRJG8lo7kE0 nOIn1vluZxYrqlyk7r6d0umH9lPO70XWWbddA4TVe/Ag4tu3vdR7cXYvHiwJVvybIuAR 5GHg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id r17si703676edo.383.2020.10.20.23.32.36; Tue, 20 Oct 2020 23:32:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394573AbgJTQXR (ORCPT + 99 others); Tue, 20 Oct 2020 12:23:17 -0400 Received: from mout.kundenserver.de ([217.72.192.75]:60545 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2394563AbgJTQXR (ORCPT ); Tue, 20 Oct 2020 12:23:17 -0400 Received: from localhost.localdomain ([82.252.146.14]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MvrRB-1kBaLT25Nn-00stxd; Tue, 20 Oct 2020 18:23:08 +0200 From: Laurent Vivier To: linux-kernel@vger.kernel.org Cc: Joshua Thompson , linux-serial@vger.kernel.org, Benjamin Herrenschmidt , linux-m68k@lists.linux-m68k.org, Geert Uytterhoeven , Paul Mackerras , linuxppc-dev@lists.ozlabs.org, Michael Ellerman , Laurent Vivier Subject: [PATCH] serial: pmac_zilog: don't init if zilog is not available Date: Tue, 20 Oct 2020 18:23:03 +0200 Message-Id: <20201020162303.1730562-1-laurent@vivier.eu> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Provags-ID: V03:K1:bKHy5QQSiE77OMXPCG5t3IA6kn0O8DJhl6MV+YUQP93v0wYpsUL coTYiKGAtOBLA3PVaVWj8x5zDK9kGX+W2jYNGYsoMOJ+HEuJCUxIACpOjZfKt0VmMqsTss8 oVtH8p5n8HCTCqiQGfX6xdIAfG94PL2nv6jie7AOlG5rdMQJGKfXBCXpbqfcyprrUMeyXxf NqH1bsfQST/Ym95UPoE9g== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:WAQu6MsbUZI=:DFWpJUDEp0IFwkElkkrpXo fbfo3nBHI5roarW7M3YyaoC2urbG0Wl54DII91AjRRDRFDIPBvsdVe6SyIdkp1XTHv23+208W 1deQ6qZf6K+8yFpZg4eHwgbC1J6bbAsrlMorSD5kryvSmqf9RmcKceASTgaXYVchQkBAWMbTW DhRZVLW0B/EbxqSlc1b33ezKElxQ/7t+i97CdaI6zVx9yUvyWyWcwkkKKu9WFiHW9ID7DcQaU EF1pa4ZTBMYNZMVfm2Wyg1IvAw31QxpAODLRC6yNqa3u773bhhj5j8nBQGB1mXjhNn9m8Sn4+ 5/Z++c17HCYYREiU6APO4nHMwSEWx0mdRuJ6vvwHU9ev2lmbdWm9xEDKb6M/CP85weFnoXQhf wC9IO5lNPF/yfso1AexECLSOeCM858pne4EXT6dXRQSIlFi0wjA/OMTgj/3Imr5AncWUmfkSx +kIltyMbVA== Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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