[PATCH] Convert i2c-mpc from a platform driver to an of_platform one

Grant Likely grant.likely at secretlab.ca
Sun Jun 29 14:57:09 EST 2008


On Tue, Jun 10, 2008 at 8:40 PM, Jon Smirl <jonsmirl at gmail.com> wrote:
> Convert i2c-mpc from a platform driver into an of_platform driver.
> This patch is much smaller since Jochen already added
> of_find_i2c_driver(). Versions of this have been posted before.
>
> Signed-ff-by: Jon Smirl <jonsmirl at gmail.com>
>
> --
> +       if (of_device_is_compatible(op->node, "mpc5200-i2c"))
> +               i2c->flags |= FSL_I2C_DEV_CLOCK_5200;

This needs to also test for "fsl,mpc5200-i2c".  "mpc5200-i2c" isn't
used on current device trees, but there may be some deployed boards
which still have this string.

> +static const struct of_device_id mpc_i2c_of_match[] = {
> +       {
> +               .compatible     = "fsl-i2c",
> +       },

You can probably shorten this by 2 lines if you change it to:
+       { .compatible = "fsl-i2c", },

Doing so makes it more readable when you need to add additional
compatible values.

g.

-- 
Grant Likely, B.Sc., P.Eng.
Secret Lab Technologies Ltd.



More information about the Linuxppc-dev mailing list