Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932745AbcLGTIK (ORCPT ); Wed, 7 Dec 2016 14:08:10 -0500 Received: from foss.arm.com ([217.140.101.70]:45986 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932353AbcLGTII (ORCPT ); Wed, 7 Dec 2016 14:08:08 -0500 Date: Wed, 7 Dec 2016 19:07:15 +0000 From: Mark Rutland To: Luis Oliveira Cc: wsa@the-dreams.de, robh+dt@kernel.org, jarkko.nikula@linux.intel.com, andriy.shevchenko@linux.intel.com, mika.westerberg@linux.intel.com, linux-i2c@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Ramiro.Oliveira@synopsys.com, Joao.Pinto@synopsys.com, CARLOS.PALMINHA@synopsys.com Subject: Re: [PATCH v4 4/5] i2c: designware: Add slave mode as separated driver Message-ID: <20161207190520.GA8658@leverpostej> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 696 Lines: 19 On Wed, Dec 07, 2016 at 05:55:51PM +0000, Luis Oliveira wrote: > +#ifndef CONFIG_ACPI > + if (!device_property_match_string(&pdev->dev, "mode", "slave")) > + i2c_dw_configure_slave(pdev); > + else > +#endif This kind of ifdeffery doesn't make sense. A single kernel binary may support both ACPI and DT (but only one is used at runtime). Note that this is the case for arm64 (our Kconfig has select OF, and our defconfig has CONFIG_ACPI=y), so this logic is broken for DT arm64 platforms. If you're trying to ensure that this *only* works in the DT case, explicitly check for an of_node, or use the of_* accessors. That applies for all instances of this pattern in this driver. Thanks, Mark.