Skip to content

Commit

Permalink
media: platform: sti: c8sectpfe: c8sectpfe-dvb: convert to use i2c_ne…
Browse files Browse the repository at this point in the history
…w_client_device()

Use the newer API returning an ERRPTR and use the new helper to bail
out.

Reviewed-by: Patrice Chotard <patrice.chotard@st.com>
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 32dc63f commit a707089
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/media/platform/sti/c8sectpfe/c8sectpfe-dvb.c
Original file line number Diff line number Diff line change
Expand Up @@ -170,8 +170,9 @@ int c8sectpfe_frontend_attach(struct dvb_frontend **fe,

/* attach tuner */
request_module("tda18212");
client = i2c_new_device(tsin->i2c_adapter, &tda18212_info);
if (!client || !client->dev.driver) {
client = i2c_new_client_device(tsin->i2c_adapter,
&tda18212_info);
if (!i2c_client_has_driver(client)) {
dvb_frontend_detach(*fe);
return -ENODEV;
}
Expand Down

0 comments on commit a707089

Please sign in to comment.