Re: [resend PATCH] driver core: property: support for generic property

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

 



On Thu, Mar 12, 2015 at 1:41 AM, Rafael J. Wysocki <rjw@xxxxxxxxxxxxx> wrote:
> On Monday, January 26, 2015 03:17:40 PM Heikki Krogerus wrote:
>> This extends the unified device property interface by adding
>> "Generic Property" to it for cases where device tree or ACPI
>> are not being used.
>>
>> That makes the unified device property interface cover also
>> most of the cases where information is extracted from custom
>> platform_data in the drivers. So if before we had to check
>> separately is there custom platform_data for a driver:
>>
>>       if (pdata)
>>               bar = pdata->bar;
>>       else
>>               device_property_read_u32(dev, "foo", &bar);
>>
>> we can now drop that check and simply always use the unified
>> device property interface.
>>
>> That makes it possible to drop a lot of boiler plate from
>> the drivers, plus quite a few header files under
>> include/linux/ describing those driver specific platform
>> data structures can be removed.
>>
>> Signed-off-by: Heikki Krogerus <heikki.krogerus@xxxxxxxxxxxxxxx>
[...]
>> @@ -704,6 +705,7 @@ struct acpi_dev_node {
>>   * @archdata:        For arch-specific additions.
>>   * @of_node: Associated device tree node.
>>   * @acpi_node:       Associated ACPI device node.
>> + * @gen_prop:        Generic device property
>>   * @devt:    For creating the sysfs "dev".
>>   * @id:              device instance
>>   * @devres_lock: Spinlock to protect the resource of the device.
>> @@ -780,6 +782,7 @@ struct device {
>>
>>       struct device_node      *of_node; /* associated device tree node */
>>       struct acpi_dev_node    acpi_node; /* associated ACPI device node */
>> +     struct dev_gen_prop     *gen_prop; /* generic device property */
>
> That doesn't seem to go in the right direction to be honest.
>
> Actually, having introduced struct fwnode_handle, we should perhaps try to
> replace both of_node and acpi_node with a single struct fwnode_handle pointer
> and then add a new fwnode_type for the "pdata" stuff.

I agree on this, but it will be a lot of work to convert...

> If you don't want to deal with of_node, which I can understand easily, it
> may be worth trying with acpi_node alone at this point and once you have
> the fwnode_handle pointer, you might use it for both ACPI and "pdata"?
>
> Grant, Arnd, I wonder what you think?

That makes sense, and we can populate the fwnode_handle even when
using DT. That will allow a transition period to move everyone over to
the fwnode_handle.

g.
--
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