* [v1,1/4] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-01-31 21:27 Andy Shevchenko
0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2018-01-31 21:27 UTC (permalink / raw)
To: dmaengine; +Cc: Andy Shevchenko, Sinan Kaya, Sakari Ailus, Vinod Koul
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, if pure OF driver calls this function, it's weird to have ACPI
companion without ACPI ID in this case.
Fixes: 80212a162329 ("ACPI / bus: Introduce acpi_get_match_data() function")
Cc: Sinan Kaya <okaya@codeaurora.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/acpi/bus.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index f87ed3be779a..b271eb16341d 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -789,12 +789,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;
-
match = acpi_match_device(dev->driver->acpi_match_table, dev);
if (!match)
return NULL;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [v1,1/4] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-01-31 21:29 Andy Shevchenko
0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2018-01-31 21:29 UTC (permalink / raw)
To: dmaengine, Rafael J. Wysocki, linux-acpi
Cc: Andy Shevchenko, Sinan Kaya, Sakari Ailus, Vinod Koul
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, if pure OF driver calls this function, it's weird to have ACPI
companion without ACPI ID in this case.
Fixes: 80212a162329 ("ACPI / bus: Introduce acpi_get_match_data() function")
Cc: Sinan Kaya <okaya@codeaurora.org>
Cc: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/acpi/bus.c | 6 ------
1 file changed, 6 deletions(-)
diff --git a/drivers/acpi/bus.c b/drivers/acpi/bus.c
index f87ed3be779a..b271eb16341d 100644
--- a/drivers/acpi/bus.c
+++ b/drivers/acpi/bus.c
@@ -789,12 +789,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;
-
match = acpi_match_device(dev->driver->acpi_match_table, dev);
if (!match)
return NULL;
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [v1,1/4] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-01-31 22:17 Sinan Kaya
0 siblings, 0 replies; 7+ messages in thread
From: Sinan Kaya @ 2018-01-31 22:17 UTC (permalink / raw)
To: Andy Shevchenko, dmaengine, Rafael J. Wysocki, linux-acpi
Cc: Sakari Ailus, Vinod Koul
On 1/31/2018 4:29 PM, 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, if pure OF driver calls this function, it's weird to have ACPI
> companion without ACPI ID in this case.
We talked about this during review.
of_match_device() does all the checking for the OF part. ACPI doesn't have
any checks.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v1,1/4] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-01 7:27 Rafael J. Wysocki
0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2018-02-01 7:27 UTC (permalink / raw)
To: Sinan Kaya, Andy Shevchenko
Cc: dmaengine, Rafael J. Wysocki, ACPI Devel Maling List,
Sakari Ailus, Vinod Koul
On Wed, Jan 31, 2018 at 11:17 PM, Sinan Kaya <okaya@codeaurora.org> wrote:
> On 1/31/2018 4:29 PM, 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, if pure OF driver calls this function, it's weird to have ACPI
>> companion without ACPI ID in this case.
>
> We talked about this during review.
>
> of_match_device() does all the checking for the OF part. ACPI doesn't have
> any checks.
Yeah, this patch is just plain incorrect AFAICS.
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v1,1/4] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-01 12:24 Andy Shevchenko
0 siblings, 0 replies; 7+ messages in thread
From: Andy Shevchenko @ 2018-02-01 12:24 UTC (permalink / raw)
To: Rafael J. Wysocki, Sinan Kaya
Cc: dmaengine, Rafael J. Wysocki, ACPI Devel Maling List,
Sakari Ailus, Vinod Koul
On Thu, 2018-02-01 at 08:27 +0100, Rafael J. Wysocki wrote:
> On Wed, Jan 31, 2018 at 11:17 PM, Sinan Kaya <okaya@codeaurora.org>
> wrote:
> > On 1/31/2018 4:29 PM, 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, if pure OF driver calls this function, it's weird to have
> > > ACPI
> > > companion without ACPI ID in this case.
> >
> > We talked about this during review.
> >
> > of_match_device() does all the checking for the OF part. ACPI
> > doesn't have
> > any checks.
>
> Yeah, this patch is just plain incorrect AFAICS.
I don't see how check dev->driver is implemented on OF side then
of_device_get_match_data() which is called by
of_fwnode_device_get_match_data() has dereferenced dev->driver w/o any
check.
I can't agree that the patch is plain incorrect, if I didn't miss
anything.
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v1,1/4] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-01 12:58 Sinan Kaya
0 siblings, 0 replies; 7+ messages in thread
From: Sinan Kaya @ 2018-02-01 12:58 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rafael J. Wysocki, dmaengine, Rafael J. Wysocki,
ACPI Devel Maling List, Sakari Ailus, Vinod Koul, dmaengine-owner
On 2018-02-01 07:24, Andy Shevchenko wrote:
> On Thu, 2018-02-01 at 08:27 +0100, Rafael J. Wysocki wrote:
>> On Wed, Jan 31, 2018 at 11:17 PM, Sinan Kaya <okaya@codeaurora.org>
>> wrote:
>> > On 1/31/2018 4:29 PM, 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, if pure OF driver calls this function, it's weird to have
>> > > ACPI
>> > > companion without ACPI ID in this case.
>> >
>> > We talked about this during review.
>> >
>> > of_match_device() does all the checking for the OF part. ACPI
>> > doesn't have
>> > any checks.
>>
>> Yeah, this patch is just plain incorrect AFAICS.
>
> I don't see how check dev->driver is implemented on OF side then
>
>
> of_device_get_match_data() which is called by
> of_fwnode_device_get_match_data() has dereferenced dev->driver w/o any
> check.
>
> I can't agree that the patch is plain incorrect, if I didn't miss
> anything.
Sorry, i should have been more specific. I was talkimg about match_data
not driver.
I agree that driver check is redundant.
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* [v1,1/4] ACPI / bus: Remove checks in acpi_get_match_data()
@ 2018-02-02 11:32 Rafael J. Wysocki
0 siblings, 0 replies; 7+ messages in thread
From: Rafael J. Wysocki @ 2018-02-02 11:32 UTC (permalink / raw)
To: Andy Shevchenko
Cc: Rafael J. Wysocki, Sinan Kaya, dmaengine, ACPI Devel Maling List,
Sakari Ailus, Vinod Koul
On Thursday, February 1, 2018 1:24:53 PM CET Andy Shevchenko wrote:
> On Thu, 2018-02-01 at 08:27 +0100, Rafael J. Wysocki wrote:
> > On Wed, Jan 31, 2018 at 11:17 PM, Sinan Kaya <okaya@codeaurora.org>
> > wrote:
> > > On 1/31/2018 4:29 PM, 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, if pure OF driver calls this function, it's weird to have
> > > > ACPI
> > > > companion without ACPI ID in this case.
> > >
> > > We talked about this during review.
> > >
> > > of_match_device() does all the checking for the OF part. ACPI
> > > doesn't have
> > > any checks.
> >
> > Yeah, this patch is just plain incorrect AFAICS.
>
> I don't see how check dev->driver is implemented on OF side then
>
>
> of_device_get_match_data() which is called by
> of_fwnode_device_get_match_data() has dereferenced dev->driver w/o any
> check.
>
> I can't agree that the patch is plain incorrect, if I didn't miss
> anything.
OK, you're right, sorry.
---
To unsubscribe from this list: send the line "unsubscribe dmaengine" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2018-02-02 11:32 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-01 12:58 [v1,1/4] ACPI / bus: Remove checks in acpi_get_match_data() Sinan Kaya
-- strict thread matches above, loose matches on Subject: below --
2018-02-02 11:32 Rafael J. Wysocki
2018-02-01 12:24 Andy Shevchenko
2018-02-01 7:27 Rafael J. Wysocki
2018-01-31 22:17 Sinan Kaya
2018-01-31 21:29 Andy Shevchenko
2018-01-31 21:27 Andy Shevchenko
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).