Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756255AbcK2LEQ (ORCPT ); Tue, 29 Nov 2016 06:04:16 -0500 Received: from mga02.intel.com ([134.134.136.20]:48306 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755425AbcK2LEJ (ORCPT ); Tue, 29 Nov 2016 06:04:09 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,568,1473145200"; d="scan'208";a="10975608" Date: Tue, 29 Nov 2016 13:04:00 +0200 From: Mika Westerberg To: Jacek Anaszewski Cc: Tin Huynh , "Rafael J. Wysocki" , Richard Purdie , linux-leds@vger.kernel.org, linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, Loc Ho , Thang Nguyen , Phong Vo , patches@apm.com Subject: Re: [PATCH V2] leds: pca963x: Add ACPI support Message-ID: <20161129110400.GY1459@lahna.fi.intel.com> References: <1480414910-16691-1-git-send-email-tnhuynh@apm.com> <676881f2-07e1-9c77-3559-3cf9832852a6@samsung.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <676881f2-07e1-9c77-3559-3cf9832852a6@samsung.com> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2075 Lines: 64 On Tue, Nov 29, 2016 at 11:55:47AM +0100, Jacek Anaszewski wrote: > On 11/29/2016 11:21 AM, Tin Huynh wrote: > > This patch enables ACPI support for leds-pca963x driver. > > > > Signed-off-by: Tin Huynh > > --- > > drivers/leds/leds-pca963x.c | 25 ++++++++++++++++++++++++- > > 1 files changed, 24 insertions(+), 1 deletions(-) > > > > Change from V1: > > -Add CONFIG_ACPI. > > > > diff --git a/drivers/leds/leds-pca963x.c b/drivers/leds/leds-pca963x.c > > index 407eba1..57f11e3 100644 > > --- a/drivers/leds/leds-pca963x.c > > +++ b/drivers/leds/leds-pca963x.c > > @@ -25,6 +25,7 @@ > > * or by adding the 'nxp,hw-blink' property to the DTS. > > */ > > > > +#include > > #include > > #include > > #include > > @@ -95,6 +96,17 @@ struct pca963x_chipdef { > > }; > > MODULE_DEVICE_TABLE(i2c, pca963x_id); > > > > +#ifdef CONFIG_ACPI > > +static const struct acpi_device_id pca963x_acpi_ids[] = { > > + { "PCA9632", pca9633 }, > > + { "PCA9633", pca9633 }, > > + { "PCA9634", pca9634 }, > > + { "PCA9635", pca9635 }, > > + { } > > +}; > > +MODULE_DEVICE_TABLE(acpi, pca963x_acpi_ids); > > +#endif > > + > > struct pca963x_led; > > > > struct pca963x { > > @@ -322,7 +334,17 @@ static int pca963x_probe(struct i2c_client *client, > > struct pca963x_chipdef *chip; > > int i, err; > > > > - chip = &pca963x_chipdefs[id->driver_data]; > > + if (id) { > > + chip = &pca963x_chipdefs[id->driver_data]; > > + } else { > > + const struct acpi_device_id *acpi_id; > > + > > + acpi_id = acpi_match_device(ACPI_PTR(pca963x_acpi_ids), > > + &client->dev); > > What kind of problem did you get while compiling without ACPI_PTR here, > when CONFIG_ACPI is disabled? I also tried this configuration but > nothing wrong happened. Also at first glance I don't see why lack of > ACPI_PTR macro could cause problems. > > Grep also doesn't show any call to acpi_match_device > with ACPI_PTR as the first argument in the existing drivers. Indeed, that is not needed at all.