hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/i2c/tvp7002.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /* Texas Instruments Triple 8-/10-BIT 165-/110-MSPS Video and Graphics
23 * Digitizer with Horizontal PLL registers
34 *
....@@ -9,16 +10,6 @@
910 * the TVP514x driver written by Vaibhav Hiremath <hvaibhav@ti.com>
1011 * and the TVP7002 driver in the TI LSP 2.10.00.14. Revisions by
1112 * Muralidharan Karicheri and Snehaprabha Narnakaje (TI).
12
- *
13
- * This program is free software; you can redistribute it and/or modify
14
- * it under the terms of the GNU General Public License as published by
15
- * the Free Software Foundation; either version 2 of the License, or
16
- * (at your option) any later version.
17
- *
18
- * This program is distributed in the hope that it will be useful,
19
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
20
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21
- * GNU General Public License for more details.
2213 */
2314 #include <linux/delay.h>
2415 #include <linux/i2c.h>
....@@ -697,9 +688,11 @@
697688 int ret;
698689
699690 ret = tvp7002_read(sd, reg->reg & 0xff, &val);
691
+ if (ret < 0)
692
+ return ret;
700693 reg->val = val;
701694 reg->size = 1;
702
- return ret;
695
+ return 0;
703696 }
704697
705698 /*
....@@ -889,7 +882,7 @@
889882 static struct tvp7002_config *
890883 tvp7002_get_pdata(struct i2c_client *client)
891884 {
892
- struct v4l2_fwnode_endpoint bus_cfg;
885
+ struct v4l2_fwnode_endpoint bus_cfg = { .bus_type = 0 };
893886 struct tvp7002_config *pdata = NULL;
894887 struct device_node *endpoint;
895888 unsigned int flags;
....@@ -939,7 +932,7 @@
939932 * Returns zero when successful, -EINVAL if register read fails or
940933 * -EIO if i2c access is not available.
941934 */
942
-static int tvp7002_probe(struct i2c_client *c, const struct i2c_device_id *id)
935
+static int tvp7002_probe(struct i2c_client *c)
943936 {
944937 struct tvp7002_config *pdata = tvp7002_get_pdata(c);
945938 struct v4l2_subdev *sd;
....@@ -1084,7 +1077,7 @@
10841077 .of_match_table = of_match_ptr(tvp7002_of_match),
10851078 .name = TVP7002_MODULE_NAME,
10861079 },
1087
- .probe = tvp7002_probe,
1080
+ .probe_new = tvp7002_probe,
10881081 .remove = tvp7002_remove,
10891082 .id_table = tvp7002_id,
10901083 };