Commit 334f6aaf authored by Wolfram Sang's avatar Wolfram Sang Committed by Mauro Carvalho Chehab

media: usb: dvb-usb: dw2102: convert to use i2c_new_client_device()

Use the newer API returning an ERRPTR and use the new helper to bail
out.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent 6e040e6f
...@@ -1590,8 +1590,8 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -1590,8 +1590,8 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
board_info.addr = 0x68; board_info.addr = 0x68;
board_info.platform_data = &m88ds3103_pdata; board_info.platform_data = &m88ds3103_pdata;
request_module("m88ds3103"); request_module("m88ds3103");
client = i2c_new_device(&d->i2c_adap, &board_info); client = i2c_new_client_device(&d->i2c_adap, &board_info);
if (client == NULL || client->dev.driver == NULL) if (!i2c_client_has_driver(client))
return -ENODEV; return -ENODEV;
if (!try_module_get(client->dev.driver->owner)) { if (!try_module_get(client->dev.driver->owner)) {
i2c_unregister_device(client); i2c_unregister_device(client);
...@@ -1609,9 +1609,9 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap) ...@@ -1609,9 +1609,9 @@ static int tt_s2_4600_frontend_attach(struct dvb_usb_adapter *adap)
board_info.addr = 0x60; board_info.addr = 0x60;
board_info.platform_data = &ts2020_config; board_info.platform_data = &ts2020_config;
request_module("ts2020"); 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); dvb_frontend_detach(adap->fe_adap[0].fe);
return -ENODEV; return -ENODEV;
} }
......
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