Commit 1f0ee65a authored by Mauro Carvalho Chehab's avatar Mauro Carvalho Chehab

[media] em28xx: unregister i2c bus 0 if bus 1 fails to register

Fix the error handling logic, making it to unregister i2c bus 0, in
case of a failure to register the second bus.
Reported-by: default avatarFrank Schäfer <fschaefer.oss@googlemail.com>
Signed-off-by: default avatarMauro Carvalho Chehab <m.chehab@samsung.com>
parent b64f8e9a
...@@ -2989,6 +2989,9 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev, ...@@ -2989,6 +2989,9 @@ static int em28xx_init_dev(struct em28xx *dev, struct usb_device *udev,
if (retval < 0) { if (retval < 0) {
em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n", em28xx_errdev("%s: em28xx_i2c_register bus 1 - error [%d]!\n",
__func__, retval); __func__, retval);
em28xx_i2c_unregister(dev, 0);
return retval; return retval;
} }
} }
......
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