Received: by 2002:a05:6a10:6744:0:0:0:0 with SMTP id w4csp4591399pxu; Tue, 20 Oct 2020 23:35:36 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx8hU7yOq97v97xU6sb4JncNqcHZ6NbI4hlD6tMX7emLqLjvcHbrApDGPXqGxzbNwU1Yjjw X-Received: by 2002:a17:906:6dc6:: with SMTP id j6mr2084738ejt.354.1603262135907; Tue, 20 Oct 2020 23:35:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1603262135; cv=none; d=google.com; s=arc-20160816; b=qWmbCTApbvbbyCtnkG1MJSud2CBLFIvM3iS4Rg9lzNIMWR8xOMgAxeVZOm/ixNgIYY PON7Ug9dYqacqV+odtVjIQQobpzUXtUlG6qmB3ZCHffenfjUVtE+3aGo1zOp0dj1dyyf u6Hz/ypr7+dcZL5rdpE4LDxrOdHcbKOnCIaMovhzqBYlJqq5sMiM+7mwA3LMhM0hcC+8 fArOJP5T4XkSZH59VqNeuPNspf80hyVqedAqlQkYfWobLDNP2vQkV5OMRYxsB+bpEuHi DRHhLV2LrDxARrqL1QBV2gIibsP556Ly00vQhtIZPY3Ean5hf3ezvH0jML1XLFtXEnPn UmIQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=mjO+x/u8ScmEagz0dHdk1Q7PfWqeeGurgWHamhmtgA4=; b=Xu85pavPpvhM6JLRHpvFvyBjh8G9yAFAe+da6eUyPe8wcAzUbEfyqYaTDKui054vxW 3XEzKCpa91aT+PyObmCOyfjZnv7nlTLMVE+u4BdXs56ZpTfgdbdWbzwHFwiR66jgZU8w 9lInCMgCgHySF0k+kY2QY+QGb0Z+EaoGwQheOoSy45M3L5dQ1n1AcpXNTrLwT2sIi+WJ tqgjHbdwRm/M/K9kZ5y5dt+nOS9bvHwwQKZPevp2iP9//F8wZs5JJUukeYkKvPqYQWJQ O3wKq7rQs+bfzZY+uRMWotDsWKUX9l0SNhqgOfYFHQO5N7w44inwmOKzNtBqzDwfrPVf s2uw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=R+iOUOOr; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h9si717557edq.358.2020.10.20.23.35.14; Tue, 20 Oct 2020 23:35:35 -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; dkim=pass header.i=@kernel.org header.s=default header.b=R+iOUOOr; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394603AbgJTQ2D (ORCPT + 99 others); Tue, 20 Oct 2020 12:28:03 -0400 Received: from mail.kernel.org ([198.145.29.99]:43358 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727812AbgJTQ2D (ORCPT ); Tue, 20 Oct 2020 12:28:03 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id E06E122242; Tue, 20 Oct 2020 16:28:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1603211282; bh=Q3yKsQuTMrcCf0pwDqkIgVljF9mzA/TS1grr6L4FtrU=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=R+iOUOOr2Xrs9zjFAHwZ8brvdqar2y0zqIlt8H+D3GRTfTAjnUfC7mA5Z7eJ5BCiK bLWvQfZZtncflquf6cgbIS33mqTyw3vEc8Wkwkm9PS1Uw/llJ6sZzwc+KsBuB7SWQ2 aCra1cHp0/IoYh0qA2M1Y8Hm7eE/g8SsUNkZsaA8= Date: Tue, 20 Oct 2020 18:28:44 +0200 From: Greg KH To: Laurent Vivier Cc: linux-kernel@vger.kernel.org, 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 Subject: Re: [PATCH] serial: pmac_zilog: don't init if zilog is not available Message-ID: <20201020162844.GA865546@kroah.com> References: <20201020162303.1730562-1-laurent@vivier.eu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20201020162303.1730562-1-laurent@vivier.eu> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 20, 2020 at 06:23:03PM +0200, Laurent Vivier wrote: > 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 Why is the #ifdef needed? We don't like putting #ifdef in .c files for good reasons. Can you make the api check for this work with and without that #ifdef needed? thanks, greg k-h