lkml.org 
[lkml]   [2016]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v2 06/10] spi: add support for ACPI reconfigure notifications
From
On Tue, May 3, 2016 at 3:19 PM, Mark Brown <broonie@kernel.org> wrote:
> On Thu, Apr 28, 2016 at 10:37:57PM +0300, Octavian Purdila wrote:
>> On Thu, Apr 28, 2016 at 8:42 PM, Mark Brown <broonie@kernel.org> wrote:
>
>> > There's more code here now than I remember but this all looks *really*
>> > close to the DT code except for the OF_POPULATED flag that we set when
>> > things are instantiated in DT. The duplication seems bad but the fact
>> > that we're missing the flag worries me... do we have guarantees that
>> > ACPI won't double register?
>
>> We use the adev->flags.visited to check when a device has been already
>> enumerated, and we skip registering a new SPI slave in that case.
>
> OK, but the fact that I need to know that isn't exactly thrilling -
> that's really the issue with the not quite duplication here. It's not
> just if the code works but also the maintainability.

I agree that this is unfortunate. I could not find a common path for
both device tree and ACPI. Perhaps when we remove of_node from struct
device and move to fwnode we could remove some duplication.

I can add a couple of comments around acpi_device_enumerated() and
adev->flags.visited = true; to make it clear that we won't double
enumerate. Will that help?

\
 
 \ /
  Last update: 2016-05-04 17:21    [W:0.059 / U:1.392 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site