[U-Boot] [PATCH v3 10/10] dm: i2c: tegra: Convert to driver model

Masahiro Yamada yamada.m at jp.panasonic.com
Mon Dec 1 12:53:20 CET 2014


Hi Simon,




On Mon, 24 Nov 2014 11:57:24 -0700
Simon Glass <sjg at chromium.org> wrote:

> +
> +U_BOOT_DRIVER(i2c_tegra) = {
> +	.name	= "i2c_tegra",
> +	.id	= UCLASS_I2C,
> +	.of_match = tegra_i2c_ids,
> +	.ofdata_to_platdata = tegra_i2c_ofdata_to_platdata,
> +	.probe	= tegra_i2c_probe,
> +	.per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),

I guess every i2c driver is supposed to have
   .per_child_auto_alloc_size = sizeof(struct dm_i2c_chip),
but it it unfortunate.

Can we have it in uclass too?


If U_BOOT_DRIVER does not have .per_child_auto_alloc_size
but UCLASS_DRIVER has it, use it.

If both U_BOOT_DRIVER and UCLASS_DRIVER have .per_child_auto_alloc_size,
the former takes precedence.





> +	.child_pre_probe = tegra_i2c_child_pre_probe,

Ditto.

tegra_i2c_child_pre_probe() does not seem Tegra-specific code at all.




Best Regards
Masahiro Yamada



More information about the U-Boot mailing list