Skip to content

Commit

Permalink
media: hdpvr: remove redundant assignment to retval
Browse files Browse the repository at this point in the history
Variable retval is initialized to a value that is never read
so this assignment is redundant.  Clean up the code by removing
retval completely and just return the error return from the
call to i2c_add_adapter.

Addresses-Coverity: ("Unused value")

Signed-off-by: Colin Ian King <[email protected]>
Signed-off-by: Hans Verkuil <[email protected]>
Signed-off-by: Mauro Carvalho Chehab <[email protected]>
  • Loading branch information
Colin Ian King authored and mchehab committed Aug 26, 2019
1 parent 7e0bb58 commit eb0a6fb
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions drivers/media/usb/hdpvr/hdpvr-i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,18 +193,14 @@ static int hdpvr_activate_ir(struct hdpvr_device *dev)

int hdpvr_register_i2c_adapter(struct hdpvr_device *dev)
{
int retval = -ENOMEM;

hdpvr_activate_ir(dev);

dev->i2c_adapter = hdpvr_i2c_adapter_template;
dev->i2c_adapter.dev.parent = &dev->udev->dev;

i2c_set_adapdata(&dev->i2c_adapter, dev);

retval = i2c_add_adapter(&dev->i2c_adapter);

return retval;
return i2c_add_adapter(&dev->i2c_adapter);
}

#endif

0 comments on commit eb0a6fb

Please sign in to comment.