[PATCH][RFC][POWERPC] i2c: adds support for i2c bus on 8xx

Milton Miller miltonm at bga.com
Sat Apr 21 01:15:32 EST 2007


At Fri Apr 20 14:27:14 EST 2007, Vitaly Bordug wrote:
> +               i2c_dev = 
> platform_device_register_simple("fsl-i2c-cpm", i, &r[0], 3);
> +               if (IS_ERR(i2c_dev)) {
> +                       ret = PTR_ERR(i2c_dev);
> +                       goto err;
> +               }
> +
> +               ret =
> +                   platform_device_add_data(i2c_dev, &i2c_data,
> +                                            sizeof(struct
> +                                                   
> fsl_i2c_platform_data));
>

This exposes a period of time where the device is registerd, but
the platform data is not available.  It might work for the
everything-in-the kernel model where the device is added before
the driver is registered, but is inherently racy.

You need to do alloc / add_resources / add_data / add.

milton




More information about the Linuxppc-dev mailing list