linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: [PATCH v2] ACPI: bus.c: Let acpi_device_get_match_data() return DT compatibility data
       [not found] <950e8d0caf9f5f55df07eba8a11b2fa8cba9f9e1.1530708691.git.nikolaus.voss@loewensteinmedical.de>
@ 2018-07-04 14:40 ` Andy Shevchenko
  2018-07-09  9:20   ` Rafael J. Wysocki
  2018-07-24 13:30   ` Nikolaus Voss
  0 siblings, 2 replies; 4+ messages in thread
From: Andy Shevchenko @ 2018-07-04 14:40 UTC (permalink / raw)
  To: Nikolaus Voss
  Cc: Rafael J. Wysocki, Len Brown, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Lorenzo Bianconi,
	Linus Walleij, Xiongfeng Wang, ACPI Devel Maling List,
	Linux Kernel Mailing List, Sudeep Holla, Ray Jui,
	Vladimir Olovyannikov, Vikram Prakash, Scott Branden,
	Srinath Mannam, Nikolaus Voss

On Tue, Jul 3, 2018 at 9:09 AM, Nikolaus Voss <nv@vosn.de> wrote:
> When using ACPI with ACPI_DT_NAMESPACE_HID/ PRP0001 HID and referring to
> of_device_id table "compatible" strings in DSD, a pointer to the
> corresponding DT table entry should be returned instead of a null
> pointer. An acpi_device_id match still takes precedence.
>

Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>

with a caveat that this is only an improvement for a _temporary_
PRP0001 users like I2C or SPI slave devices.
Please, don't consider this change as a valid point to (ab)use PRP0001
in a cases where devices are not "hotpluggable".

> v2: improve readability (as suggested by Andy Shevchenko)
>
> Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
> ---
>  drivers/acpi/bus.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
> index 84b4a62018eb..58575fdace78 100644
> --- a/drivers/acpi/bus.c
> +++ b/drivers/acpi/bus.c
> @@ -832,13 +832,22 @@ EXPORT_SYMBOL_GPL(acpi_match_device);
>
>  const void *acpi_device_get_match_data(const struct device *dev)
>  {
> -       const struct acpi_device_id *match;
> +       const struct acpi_device_id *acpi_id = NULL;
> +       const struct of_device_id *of_id = NULL;
> +       const struct device_driver *drv = dev->driver;
> +       bool match;
> +
> +       match = __acpi_match_device(acpi_companion_match(dev),
> +                                   drv->acpi_match_table,
> +                                   drv->of_match_table, &acpi_id, &of_id);
>
> -       match = acpi_match_device(dev->driver->acpi_match_table, dev);
>         if (!match)
>                 return NULL;
> +
> +       if (of_id)
> +               return (const void*)of_id->data;
>
> -       return (const void *)match->driver_data;
> +       return (const void*)acpi_id->driver_data;
>  }
>  EXPORT_SYMBOL_GPL(acpi_device_get_match_data);
>
> --
> 2.17.1
>



-- 
With Best Regards,
Andy Shevchenko

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ACPI: bus.c: Let acpi_device_get_match_data() return DT compatibility data
  2018-07-04 14:40 ` [PATCH v2] ACPI: bus.c: Let acpi_device_get_match_data() return DT compatibility data Andy Shevchenko
@ 2018-07-09  9:20   ` Rafael J. Wysocki
  2018-07-24 13:31     ` Nikolaus Voss
  2018-07-24 13:30   ` Nikolaus Voss
  1 sibling, 1 reply; 4+ messages in thread
From: Rafael J. Wysocki @ 2018-07-09  9:20 UTC (permalink / raw)
  To: Nikolaus Voss
  Cc: Andy Shevchenko, Len Brown, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Lorenzo Bianconi,
	Linus Walleij, Xiongfeng Wang, ACPI Devel Maling List,
	Linux Kernel Mailing List, Sudeep Holla, Ray Jui,
	Vladimir Olovyannikov, Vikram Prakash, Scott Branden,
	Srinath Mannam, Nikolaus Voss

On Wednesday, July 4, 2018 4:40:34 PM CEST Andy Shevchenko wrote:
> On Tue, Jul 3, 2018 at 9:09 AM, Nikolaus Voss <nv@vosn.de> wrote:
> > When using ACPI with ACPI_DT_NAMESPACE_HID/ PRP0001 HID and referring to
> > of_device_id table "compatible" strings in DSD, a pointer to the
> > corresponding DT table entry should be returned instead of a null
> > pointer. An acpi_device_id match still takes precedence.
> >
> 
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
> 
> with a caveat that this is only an improvement for a _temporary_
> PRP0001 users like I2C or SPI slave devices.
> Please, don't consider this change as a valid point to (ab)use PRP0001
> in a cases where devices are not "hotpluggable".
> 
> > v2: improve readability (as suggested by Andy Shevchenko)
> >
> > Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>

Nikolaus, please resend the v2 with the Andy's tag to linux-acpi@gver.kernel.org

It won't be applied otherwise.

Thanks,
Rafael


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ACPI: bus.c: Let acpi_device_get_match_data() return DT compatibility data
  2018-07-04 14:40 ` [PATCH v2] ACPI: bus.c: Let acpi_device_get_match_data() return DT compatibility data Andy Shevchenko
  2018-07-09  9:20   ` Rafael J. Wysocki
@ 2018-07-24 13:30   ` Nikolaus Voss
  1 sibling, 0 replies; 4+ messages in thread
From: Nikolaus Voss @ 2018-07-24 13:30 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Rafael J. Wysocki, Len Brown, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Lorenzo Bianconi,
	Linus Walleij, Xiongfeng Wang, ACPI Devel Maling List,
	Linux Kernel Mailing List, Sudeep Holla, Ray Jui,
	Vladimir Olovyannikov, Vikram Prakash, Scott Branden,
	Srinath Mannam, Voss, Nikolaus

On Wed, 4 Jul 2018, Andy Shevchenko wrote:
> On Tue, Jul 3, 2018 at 9:09 AM, Nikolaus Voss <nv@vosn.de> wrote:
>> When using ACPI with ACPI_DT_NAMESPACE_HID/ PRP0001 HID and referring to
>> of_device_id table "compatible" strings in DSD, a pointer to the
>> corresponding DT table entry should be returned instead of a null
>> pointer. An acpi_device_id match still takes precedence.
>>
>
> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>
> with a caveat that this is only an improvement for a _temporary_
> PRP0001 users like I2C or SPI slave devices.
> Please, don't consider this change as a valid point to (ab)use PRP0001
> in a cases where devices are not "hotpluggable".

Will add the caveat and resend. Andy, thanks for reviewing!

Niko


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH v2] ACPI: bus.c: Let acpi_device_get_match_data() return DT compatibility data
  2018-07-09  9:20   ` Rafael J. Wysocki
@ 2018-07-24 13:31     ` Nikolaus Voss
  0 siblings, 0 replies; 4+ messages in thread
From: Nikolaus Voss @ 2018-07-24 13:31 UTC (permalink / raw)
  To: Rafael J. Wysocki
  Cc: Andy Shevchenko, Len Brown, Jonathan Cameron, Hartmut Knaack,
	Lars-Peter Clausen, Peter Meerwald-Stadler, Lorenzo Bianconi,
	Linus Walleij, Xiongfeng Wang, ACPI Devel Maling List,
	Linux Kernel Mailing List, Sudeep Holla, Ray Jui,
	Vladimir Olovyannikov, Vikram Prakash, Scott Branden,
	Srinath Mannam

On Mon, 9 Jul 2018, Rafael J. Wysocki wrote:
> On Wednesday, July 4, 2018 4:40:34 PM CEST Andy Shevchenko wrote:
>> On Tue, Jul 3, 2018 at 9:09 AM, Nikolaus Voss <nv@vosn.de> wrote:
>>> When using ACPI with ACPI_DT_NAMESPACE_HID/ PRP0001 HID and referring to
>>> of_device_id table "compatible" strings in DSD, a pointer to the
>>> corresponding DT table entry should be returned instead of a null
>>> pointer. An acpi_device_id match still takes precedence.
>>>
>>
>> Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com>
>>
>> with a caveat that this is only an improvement for a _temporary_
>> PRP0001 users like I2C or SPI slave devices.
>> Please, don't consider this change as a valid point to (ab)use PRP0001
>> in a cases where devices are not "hotpluggable".
>>
>>> v2: improve readability (as suggested by Andy Shevchenko)
>>>
>>> Signed-off-by: Nikolaus Voss <nikolaus.voss@loewensteinmedical.de>
>
> Nikolaus, please resend the v2 with the Andy's tag to linux-acpi@gver.kernel.org
>
> It won't be applied otherwise.

Ok, thanks for the hint!

Niko


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-07-24 13:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <950e8d0caf9f5f55df07eba8a11b2fa8cba9f9e1.1530708691.git.nikolaus.voss@loewensteinmedical.de>
2018-07-04 14:40 ` [PATCH v2] ACPI: bus.c: Let acpi_device_get_match_data() return DT compatibility data Andy Shevchenko
2018-07-09  9:20   ` Rafael J. Wysocki
2018-07-24 13:31     ` Nikolaus Voss
2018-07-24 13:30   ` Nikolaus Voss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).