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

Grant Likely
2008-06-29T04:57:09Z

On Tue, Jun 10, 2008 at 8:40 PM, Jon Smirl <jonsmirl@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@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.