Skip to content

Commit 54b1b41

Browse files
peda-rmchehab
authored andcommitted
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: Peter Rosin <[email protected]> Signed-off-by: Hans Verkuil <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent c6e3bdb commit 54b1b41

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

drivers/media/usb/cx231xx/cx231xx-i2c.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ int cx231xx_i2c_register(struct cx231xx_i2c *bus)
538538

539539
bus->i2c_adap.algo_data = bus;
540540
i2c_set_adapdata(&bus->i2c_adap, &dev->v4l2_dev);
541-
i2c_add_adapter(&bus->i2c_adap);
541+
bus->i2c_rc = i2c_add_adapter(&bus->i2c_adap);
542542

543543
if (0 != bus->i2c_rc)
544544
dev_warn(dev->dev,

drivers/media/usb/cx231xx/cx231xx.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,7 @@ struct cx231xx_i2c {
476476

477477
/* i2c i/o */
478478
struct i2c_adapter i2c_adap;
479-
u32 i2c_rc;
479+
int i2c_rc;
480480

481481
/* different settings for each bus */
482482
u8 i2c_period;

0 commit comments

Comments
 (0)