Skip to content
Snippets Groups Projects
Commit fdec36f2 authored by Simon Glass's avatar Simon Glass Committed by Bin Meng
Browse files

tegra: i2c: Change driver to use helper function


Now that we have uclass_first_device_drvdata(), use it from the I2C driver
to reduce code duplication.

Signed-off-by: default avatarSimon Glass <sjg@chromium.org>
Reviewed-by: default avatarHeiko Schocher <hs@denx.de>
Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
parent ae44cafc
No related branches found
No related tags found
No related merge requests found
......@@ -499,18 +499,7 @@ static int tegra_i2c_xfer(struct udevice *bus, struct i2c_msg *msg,
int tegra_i2c_get_dvc_bus(struct udevice **busp)
{
struct udevice *bus;
for (uclass_first_device(UCLASS_I2C, &bus);
bus;
uclass_next_device(&bus)) {
if (dev_get_driver_data(bus) == TYPE_DVC) {
*busp = bus;
return 0;
}
}
return -ENODEV;
return uclass_first_device_drvdata(UCLASS_I2C, TYPE_DVC, busp);
}
static const struct dm_i2c_ops tegra_i2c_ops = {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment