]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commitdiff
media: usb: hdpvr: convert to use i2c_new_client_device()
authorWolfram Sang <wsa+renesas@sang-engineering.com>
Thu, 26 Mar 2020 21:09:45 +0000 (22:09 +0100)
committerMauro Carvalho Chehab <mchehab+huawei@kernel.org>
Tue, 14 Apr 2020 09:31:48 +0000 (11:31 +0200)
Move away from the deprecated API and return the shiny new ERRPTR where
useful.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
drivers/media/usb/hdpvr/hdpvr-core.c
drivers/media/usb/hdpvr/hdpvr-i2c.c

index b75c18a012a7302d8878a5446d0b7277440f07aa..52e05a69c46eeceaa1c52a2d581fd489a53bd0d2 100644 (file)
@@ -363,9 +363,9 @@ static int hdpvr_probe(struct usb_interface *interface,
        }
 
        client = hdpvr_register_ir_i2c(dev);
-       if (!client) {
+       if (IS_ERR(client)) {
                v4l2_err(&dev->v4l2_dev, "i2c IR device register failed\n");
-               retval = -ENODEV;
+               retval = PTR_ERR(client);
                goto reg_fail;
        }
 #endif
index 785c8508a46e5a989ec7f81af97dea3d0d9c05e9..070559b01b01b81c7acb40dd4b57adeebdd7b48b 100644 (file)
@@ -44,7 +44,7 @@ struct i2c_client *hdpvr_register_ir_i2c(struct hdpvr_device *dev)
        init_data->polling_interval = 405; /* ms, duplicated from Windows */
        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,