[RFC PATCH 08/14] ARM: versatile-i2c driver DT port
Grant Likely
grant.likely at secretlab.ca
Thu Aug 19 07:17:59 EST 2010
On Wed, Aug 18, 2010 at 12:59 PM, Lorenzo Pieralisi
<lorenzo.pieralisi at arm.com> wrote:
> When OF is enabled, each driver should define a match table to
> allow the kernel to recognise drivers suitable for a given device.
> Initialization is carried out through a static inline at driver init
> time. The match-table is declared following OF bindings.
>
> This patch adds the required initialization call to the versatile-i2c
> driver.
>
> Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi at arm.com>
> ---
> drivers/i2c/busses/i2c-versatile.c | 6 ++++++
> 1 files changed, 6 insertions(+), 0 deletions(-)
>
> diff --git a/drivers/i2c/busses/i2c-versatile.c b/drivers/i2c/busses/i2c-versatile.c
> index 6055601..ea8e3b5 100644
> --- a/drivers/i2c/busses/i2c-versatile.c
> +++ b/drivers/i2c/busses/i2c-versatile.c
> @@ -133,6 +133,11 @@ static int i2c_versatile_remove(struct platform_device *dev)
> return 0;
> }
>
> +static struct of_device_id versatile_i2c_matches[] = {
> + { .compatible = "arm,versatile-i2c"},
> + {},
> +};
> +
> static struct platform_driver i2c_versatile_driver = {
> .probe = i2c_versatile_probe,
> .remove = i2c_versatile_remove,
> @@ -144,6 +149,7 @@ static struct platform_driver i2c_versatile_driver = {
>
> static int __init i2c_versatile_init(void)
> {
> + platform_init_match(&i2c_versatile_driver, versatile_i2c_matches);
Ditto to my comments on the last driver. I'd rather see the pointer
statically assigned instead of set at runtime.
> return platform_driver_register(&i2c_versatile_driver);
> }
>
> --
> 1.6.3.3
>
>
--
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.
More information about the devicetree-discuss
mailing list