Re: [PATCH v2 3/6] ACPI / bus: Remove checks in acpi_get_match_data()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, Feb 1, 2018 at 9:46 PM, Andy Shevchenko
<andriy.shevchenko@xxxxxxxxxxxxxxx> wrote:
> On Thu, 2018-02-01 at 22:20 +0200, Andy Shevchenko wrote:
>> As well as its sibling of_device_get_match_data() has no such checks,
>> no need to do it in acpi_get_match_data().
>>
>> First of all, we are not supposed to call fwnode API like this without
>> driver attached.
>>
>> Second, since __acpi_match_device() does check input parameter there
>> is
>> no need to duplicate it outside.
>>
>> Fixes: 80212a162329 ("ACPI / bus: Introduce acpi_get_match_data()
>> function")
>> Cc: Sinan Kaya <okaya@xxxxxxxxxxxxxx>
>> Cc: Sakari Ailus <sakari.ailus@xxxxxxxxxxxxxxx>
>> Cc: Vinod Koul <vinod.koul@xxxxxxxxx>
>> Signed-off-by: Andy Shevchenko <andriy.shevchenko@xxxxxxxxxxxxxxx>
>> ---
>> v2: rebase on top of new patches, rephrase commit message
>>  drivers/acpi/bus.c | 6 ------
>>  1 file changed, 6 deletions(-)
>>
>> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
>> index f3a7c29e9190..413e4b1cb1be 100644
>> --- a/drivers/acpi/bus.c
>> +++ b/drivers/acpi/bus.c
>> @@ -791,12 +791,6 @@ void *acpi_get_match_data(const struct device
>> *dev)
>>  {
>>       const struct acpi_device_id *match;
>>
>> -     if (!dev->driver)
>> -             return NULL;
>> -
>
>> -     if (!dev->driver->acpi_match_table)
>> -             return NULL;
>> -
>
> Perhaps I have to add that this conditional prevents
> device_get_match_data() to work on PRP0001 devices AFAIU.

Yes, please.

I'm also not sure if the Fixes: tag is really applicable to this.
--
To unsubscribe from this list: send the line "unsubscribe linux-acpi" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux IBM ACPI]     [Linux Power Management]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]     [Linux Resources]

  Powered by Linux