[U-Boot] [PATCH v2] ARM: imx6: DHCOM i.MX6 PDK: Switch to DM for I2C

Marek Vasut marex at denx.de
Fri Jul 5 12:23:40 UTC 2019


On 7/5/19 12:46 PM, Ludwig Zenz wrote:
[...]

>  static int setup_dhcom_mac_from_fuse(void)
>  {
> +	struct udevice *dev;
>  	unsigned char enetaddr[6];
>  	int ret;
>  
> @@ -228,13 +142,13 @@ static int setup_dhcom_mac_from_fuse(void)
>  		return 0;
>  	}
>  
> -	ret = i2c_set_bus_num(2);
> +	ret = uclass_first_device_err(UCLASS_I2C_EEPROM, &dev);

What about uclass_find_device_by_of_node() ? Then you can specify a
stable fixed hardware path to the EEPROM, and no matter how many EEPROMs
someone connects to the board, this code won't be affected.

[...]


More information about the U-Boot mailing list