From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1762863AbdDSMBu (ORCPT ); Wed, 19 Apr 2017 08:01:50 -0400 Received: from mga04.intel.com ([192.55.52.120]:6801 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761640AbdDSMBr (ORCPT ); Wed, 19 Apr 2017 08:01:47 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.37,221,1488873600"; d="scan'208";a="1137624618" Message-ID: <1492603297.24567.81.camel@linux.intel.com> Subject: Re: [tip:x86/platform 1/1] platform_bt.c:undefined reference to `gpiod_add_lookup_table' From: Andy Shevchenko To: Linus Walleij Cc: Andy Shevchenko , Arnd Bergmann , kbuild test robot , "kbuild-all@01.org" , "linux-kernel@vger.kernel.org" , tipbuild@zytor.com, Ingo Molnar Date: Wed, 19 Apr 2017 15:01:37 +0300 In-Reply-To: References: <201704030713.jb1PXu29%fengguang.wu@intel.com> <1491319621.708.128.camel@linux.intel.com> <1492522889.24567.66.camel@linux.intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.6-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2017-04-19 at 11:01 +0200, Linus Walleij wrote: > On Tue, Apr 18, 2017 at 3:41 PM, Andy Shevchenko > wrote: > > On Fri, 2017-04-07 at 12:36 +0200, Linus Walleij wrote: > > > They return NULL if the GPIO is not there, or if the > > > GPIO library is compiled out (as of HEAD, due to the > > > patch from Dmitry T.) > > > > I'm talking if they are used or not in hci_bcm.c. > > > > Just checked and indeed the driver is using _optional() variants. > > This means GPIOLIB is optional to the driver. > > GPIOLIB's idea of "optional" should preferrably be the same as > an optional regulator, i.e. "electrically optional" not "software > optional". > > The regulator example is for example an ADC reference voltage that is > not strictly required, then it is optional, and the ADC can use some > internal reference voltage instead. It does not mean that the > regulator > framework is optional. Yeah, my point is that hci_bcm.c by design can work without GPIOs (looks like it might be hardware without dedicated GPIO lines, though I'm quite in doubts there is one exists) which makes GPIOLIB requirement optional. Thus, platform code in question (this patch) should cope with absence of gpiod_add_lookup_table(). The question is what by your opinion is the best approach here (I put them in order of my preferences): 1) make a stub for gpiod_add_lookup_table() for !GPIOLIB case for all users; 2) as in 1) but inside this very user; 3) uglify Makefile with something like ifeq $(CONFIG_GPIOLIB,y); 4) create a Kconfig option for this very user (the worst variant I could even think about). -- Andy Shevchenko Intel Finland Oy