Commit 54b1b41f authored by Peter Rosin's avatar Peter Rosin Committed by Mauro Carvalho Chehab

media: cx231xx: fail probe if i2c_add_adapter fails

While at it, change the type of the previously always-zero i2c_rc
member to int, matching the returned type from i2c_add_adapter.
Signed-off-by: default avatarPeter Rosin <peda@axentia.se>
Signed-off-by: default avatarHans Verkuil <hans.verkuil@cisco.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent c6e3bdb8
......@@ -538,7 +538,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
bus->i2c_adap.algo_data = bus;
i2c_set_adapdata(&bus->i2c_adap, &dev->v4l2_dev);
i2c_add_adapter(&bus->i2c_adap);
bus->i2c_rc = i2c_add_adapter(&bus->i2c_adap);
if (0 != bus->i2c_rc)
dev_warn(dev->dev,
......
......@@ -476,7 +476,7 @@ struct cx231xx_i2c {
/* i2c i/o */
struct i2c_adapter i2c_adap;
u32 i2c_rc;
int i2c_rc;
/* different settings for each bus */
u8 i2c_period;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment