Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2811298imu; Sun, 23 Dec 2018 08:18:29 -0800 (PST) X-Google-Smtp-Source: ALg8bN7JbHf5BYy/Mo4d6pv+JP6wNLtkvtyWGNh7p7XDdMYIvPV5K6keR6ezdDo3Np31fnXFq71v X-Received: by 2002:a65:41c2:: with SMTP id b2mr9478539pgq.67.1545581908996; Sun, 23 Dec 2018 08:18:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1545581908; cv=none; d=google.com; s=arc-20160816; b=U0cdJYVnKoIoEYGgDA5CphfB0PvrrksUxlsfbHk0MlYofF7omD0vqUoO0jGAeR3UAv k1qRI/vT2ES5dIwRk8bKH8Rzj6V/CjejmSZFVyjiwEy20csuYiAKfffVH3kax4dxNtA7 ayE3LI18i9M292D7hPRjrIjyx80r5Ag7JuAvwwJkIUGUgeesB5bXn6SndviBx1O1KWvl k9n4KP4Y9ywRjh77uRoj28t6B9yupLesH6bc9YuuYksviY8B5tL33Bhp7H8qitxMm7sf OeC2KAIHSNZig6pL5y6gVQA9EybRJiY0CEm1eOgEgL64IS9ie7THVtYx7wSXjsdnwYyk Gw3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=Z5At6JV5086mQndXvZZhV9p49VamnpSDcYuLqUIL1Xo=; b=RRVAcchqvAoocjP84U87sqQ6NLJQIqYJOOt8R7bkVfADgb8gTQE5HvLLxRlL9AJh87 yFb/1JLnMwU2SooGWX1k61iQk5xd/lOoBNaLGWDNW6TKdLoPx705sa6Glq3SObnmU5HE +XD+o1tNhsrv7CQq17Wdb1YPGWsMTVIShlbzs4xn5av0DKVOzSwnI2XXp5xYPq2hvfhx ZER1gFEFaWoXiqNWwcvNvCocQBPXBoLktPSEIVwsaMc9CQOZq3gbw4TiulsPV9QYTRoB RznksLvcpdoCqGfEe5wUlO/b9R6q8+pIMyExTI5aiS9MlldaS1/b2Doa6C5Pgy3r04AS HaNA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x9si25207003pgh.12.2018.12.23.08.18.13; Sun, 23 Dec 2018 08:18:28 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391367AbeLVR2k (ORCPT + 99 others); Sat, 22 Dec 2018 12:28:40 -0500 Received: from bmailout1.hostsharing.net ([83.223.95.100]:40969 "EHLO bmailout1.hostsharing.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728109AbeLVR2j (ORCPT ); Sat, 22 Dec 2018 12:28:39 -0500 Received: from h08.hostsharing.net (h08.hostsharing.net [83.223.95.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.hostsharing.net", Issuer "COMODO RSA Domain Validation Secure Server CA" (not verified)) by bmailout1.hostsharing.net (Postfix) with ESMTPS id 5D6C630000CC2; Sat, 22 Dec 2018 09:03:17 +0100 (CET) Received: by h08.hostsharing.net (Postfix, from userid 100393) id 328BBEB941; Sat, 22 Dec 2018 09:03:17 +0100 (CET) Date: Sat, 22 Dec 2018 09:03:17 +0100 From: Lukas Wunner To: Sinan Kaya Cc: linux-pci@vger.kernel.org, linux-acpi@vger.kernel.org, Darren Hart , Andy Shevchenko , platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 06/11] platform/x86: apple-gmux: hide PCI specific code Message-ID: <20181222080317.qicyihyauia6n63w@wunner.de> References: <20181222001452.7474-1-okaya@kernel.org> <20181222001452.7474-7-okaya@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181222001452.7474-7-okaya@kernel.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 22, 2018 at 12:14:47AM +0000, Sinan Kaya wrote: > Code is scanning PCI bus to find out if it is switchable or not. If > CONFIG_PCI is not set, assume unswitchable. > > Signed-off-by: Sinan Kaya > --- > drivers/platform/x86/apple-gmux.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/drivers/platform/x86/apple-gmux.c b/drivers/platform/x86/apple-gmux.c > index fd2ffebc868f..b552b54bf58b 100644 > --- a/drivers/platform/x86/apple-gmux.c > +++ b/drivers/platform/x86/apple-gmux.c > @@ -742,8 +742,12 @@ static int gmux_probe(struct pnp_dev *pnp, const struct pnp_device_id *id) > * If Thunderbolt is present, the external DP port is not fully > * switchable. Force its AUX channel to the discrete GPU. > */ > +#ifdef CONFIG_PCI > gmux_data->external_switchable = > !bus_for_each_dev(&pci_bus_type, NULL, NULL, is_thunderbolt); > +#else > + gmux_data->external_switchable = false; > +#endif > if (!gmux_data->external_switchable) > gmux_write8(gmux_data, GMUX_PORT_SWITCH_EXTERNAL, 3); This driver is only used on 2008+ MacBook Pros and the 2013+ Mac Pro, all of which have PCI and are pretty much unusable with CONFIG_PCI=n. So it is okay to just add "depends on PCI" for this driver, as you did with other drivers, and I think that's preferrable to an #ifdef. You can also drop the "platform/x86: " prefix from the subject if you like, all previous commits to this driver just use "apple-gmux: ". If you are okay with these changes, feel free to add my Reviewed-by when respinning. Thanks, Lukas