lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CANQ9TuC3EvcjBnQD-trYPxHyJpWww9xNkF7H3poPfDOhnUMFPg@mail.gmail.com>
Date:   Tue, 29 Nov 2016 21:47:26 +0700
From:   Tin Huynh <tnhuynh@....com>
To:     Mika Westerberg <mika.westerberg@...ux.intel.com>
Cc:     Jacek Anaszewski <j.anaszewski@...sung.com>,
        "Rafael J. Wysocki" <rjw@...ysocki.net>,
        Richard Purdie <rpurdie@...ys.net>, linux-leds@...r.kernel.org,
        linux-kernel@...r.kernel.org, linux-acpi@...r.kernel.org,
        Loc Ho <lho@....com>, Thang Nguyen <tqnguyen@....com>,
        Phong Vo <pvo@....com>, patches <patches@....com>
Subject: Re: [PATCH V2] leds: pca963x: Add ACPI support

On Tue, Nov 29, 2016 at 6:04 PM, Mika Westerberg
<mika.westerberg@...ux.intel.com> wrote:
> 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 <tnhuynh@....com>
>> > ---
>> >  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 <linux/acpi.h>
>> >  #include <linux/module.h>
>> >  #include <linux/delay.h>
>> >  #include <linux/string.h>
>> > @@ -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.
Sorry about that . The PATCH V1 should work fine both with or without
CONFIG_ACPI.
So V1 should be better . Please ignore PATCH V2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ