Re: [RFC 0/4] of: introduce of_dev_get_platdata()
From: Kim, Milo
Date: Mon Aug 31 2015 - 21:24:15 EST
Hi Rob,
On 8/28/2015 9:59 PM, Rob Herring wrote:
On Fri, Aug 28, 2015 at 4:12 AM, Milo Kim<milo.kim@xxxxxx> wrote:
>New function, 'of_dev_get_platdata()'
> - provides unified handling of getting device platform data
> - supports DT and non-DT(legacy) cases
> - removes duplicated code from each driver
> - keeps driver specific code simple in each driver
This works in cases where DT data and platform_data are aligned. In
many cases they are not. A common binding problem is people blindly
copying platform_data fields to DT properties for things that are not
h/w properties. I worry that this would encourage this behavior.
OK, got your point. Thanks.
We already have a generalized method for retrieving properties
independent of DT or ACPI. There's no reason this couldn't be extended
to retrieve properties out of platform_data using the same interface.
Also, perhaps in some drivers we can remove platform_data now if all
users are converted to DT.
This work requires two steps.
1) remove platform data configuration from board-*.c
2) if all host/platform support only the DT, then move device platform
data structure in a header to each driver space.
However, I'm concerning about some use case.
After this cleanup, drivers may not work properly in some platforms
which do not support the DT. There is no way to configure HW properties.
Drivers should run on any kind of hosts(processors) so I'm thinking
about the compatibility/dependency issue. Am I missing something?
Milo
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/