From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751146AbdALREA (ORCPT ); Thu, 12 Jan 2017 12:04:00 -0500 Received: from mga06.intel.com ([134.134.136.31]:41406 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751026AbdALRC6 (ORCPT ); Thu, 12 Jan 2017 12:02:58 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.33,219,1477983600"; d="scan'208";a="808108299" Message-ID: <1484240482.2133.92.camel@linux.intel.com> Subject: Re: [PATCH] i2c: core: helper function to detect slave mode From: Andy Shevchenko To: Vladimir Zapolskiy , Andy Shevchenko Cc: Luis Oliveira , Wolfram Sang , Rob Herring , Mark Rutland , Jarkko Nikula , Mika Westerberg , linux-i2c@vger.kernel.org, devicetree , "linux-kernel@vger.kernel.org" , Ramiro.Oliveira@synopsys.com, Joao Pinto , CARLOS.PALMINHA@synopsys.com Date: Thu, 12 Jan 2017 19:01:22 +0200 In-Reply-To: <3748130b-5321-12eb-ec75-e2637dd9fc54@mleia.com> References: <73246c4a-504c-52d7-dde4-970a45dca0bd@mleia.com> <3748130b-5321-12eb-ec75-e2637dd9fc54@mleia.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.22.3-1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, 2017-01-07 at 03:24 +0200, Vladimir Zapolskiy wrote: > On 01/07/2017 02:19 AM, Andy Shevchenko wrote: > > On Sat, Jan 7, 2017 at 1:43 AM, Vladimir Zapolskiy > > wrote: > > > On 01/07/2017 12:45 AM, Andy Shevchenko wrote: > > > > +             } > > > > > > +     } else if (IS_BUILTIN(CONFIG_ACPI) && > > > > > > ACPI_HANDLE(dev)) { > > > > > > +             dev_dbg(dev, "ACPI slave is not supported > > > > > > yet\n"); > > > > > > +     } > > > > > > > > > > If so, then it might be better to drop else-if stub for now. > > > > > > > > Please, don't. > > > > > > > > > > Why do you ask for this stub to be added? > > > > 1. Exactly the reason you asked above. Here is the code which has > > built differently on different platforms. x86 usually is not using > > CONFIG_OF, ARM doesn't ACPI (versus ARM64). Check GPIO library for > > existing examples. > > From the context by the stub I mean dev_dbg() in > i2c_slave_mode_detect() > function, I don't see a connection to GPIO library, please clarify. I agree that is not good proof for using IS_ENABLED/IS_BUILTIN macro. > > 2. We might add that support later, but here is again, just no-op. > > > > So, what is your strong argument here against that? > > When the support is ready for ACPI case, you'll remove the added > dev_dbg(), and I don't see a good point by adding it temporarily. It would remind me to look at it at some point. > What is wrong with the approach of adding the ACPI case handling > branch when it is ready and remove any kind of stubs right now? I will not object. Here is maintainer, let him speak. > On ACPI platforms the function returns 'false' always, will the > function work correctly (= corresponding to its description) as is? Yes. -- Andy Shevchenko Intel Finland Oy