Skip to content

Commit

Permalink
media: usb: dvb-usb: dw2102: convert to use i2c_new_client_device()
Browse files Browse the repository at this point in the history
Use the newer API returning an ERRPTR and use the new helper to bail
out.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Sean Young <sean@mess.org>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
  • Loading branch information
Wolfram Sang authored and Mauro Carvalho Chehab committed Jan 9, 2020
1 parent 6e040e6 commit 334f6aa
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions drivers/media/usb/dvb-usb/dw2102.c
Original file line number Diff line number Diff line change
Expand Up @@ -1590,8 +1590,8 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
board_info.addr = 0x68;
board_info.platform_data = &m88ds3103_pdata;
request_module("m88ds3103");
client = i2c_new_device(&d->i2c_adap, &board_info);
if (client == NULL || client->dev.driver == NULL)
client = i2c_new_client_device(&d->i2c_adap, &board_info);
if (!i2c_client_has_driver(client))
return -ENODEV;
if (!try_module_get(client->dev.driver->owner)) {
i2c_unregister_device(client);
Expand All @@ -1609,9 +1609,9 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
board_info.addr = 0x60;
board_info.platform_data = &ts2020_config;
request_module("ts2020");
client = i2c_new_device(i2c_adapter, &board_info);
client = i2c_new_client_device(i2c_adapter, &board_info);

if (client == NULL || client->dev.driver == NULL) {
if (!i2c_client_has_driver(client)) {
dvb_frontend_detach(adap->fe_adap[0].fe);
return -ENODEV;
}
Expand Down

0 comments on commit 334f6aa

Please sign in to comment.