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

media: usb: hdpvr: convert to use i2c_new_client_device()

Move away from the deprecated API and return the shiny new ERRPTR where
useful.
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: default avatarHans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+huawei@kernel.org>
parent cb3c38c9
...@@ -363,9 +363,9 @@ static int hdpvr_probe(struct usb_interface *interface, ...@@ -363,9 +363,9 @@ static int hdpvr_probe(struct usb_interface *interface,
} }
client = hdpvr_register_ir_i2c(dev); client = hdpvr_register_ir_i2c(dev);
if (!client) { if (IS_ERR(client)) {
v4l2_err(&dev->v4l2_dev, "i2c IR device register failed\n"); v4l2_err(&dev->v4l2_dev, "i2c IR device register failed\n");
retval = -ENODEV; retval = PTR_ERR(client);
goto reg_fail; goto reg_fail;
} }
#endif #endif
......
...@@ -44,7 +44,7 @@ struct i2c_client *hdpvr_register_ir_i2c(struct hdpvr_device *dev) ...@@ -44,7 +44,7 @@ struct i2c_client *hdpvr_register_ir_i2c(struct hdpvr_device *dev)
init_data->polling_interval = 405; /* ms, duplicated from Windows */ init_data->polling_interval = 405; /* ms, duplicated from Windows */
info.platform_data = init_data; info.platform_data = init_data;
return i2c_new_device(&dev->i2c_adapter, &info); return i2c_new_client_device(&dev->i2c_adapter, &info);
} }
static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus, static int hdpvr_i2c_read(struct hdpvr_device *dev, int bus,
......
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