forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/cx18/cx18-i2c.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * cx18 I2C functions
34 *
....@@ -5,16 +6,6 @@
56 *
67 * Copyright (C) 2007 Hans Verkuil <hverkuil@xs4all.nl>
78 * Copyright (C) 2008 Andy Walls <awalls@md.metrocast.net>
8
- *
9
- * This program is free software; you can redistribute it and/or modify
10
- * it under the terms of the GNU General Public License as published by
11
- * the Free Software Foundation; either version 2 of the License, or
12
- * (at your option) any later version.
13
- *
14
- * This program is distributed in the hope that it will be useful,
15
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
16
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17
- * GNU General Public License for more details.
189 */
1910
2011 #include "cx18-driver.h"
....@@ -83,7 +74,7 @@
8374 unsigned short addr_list[2] = { addr, I2C_CLIENT_END };
8475
8576 memset(&info, 0, sizeof(struct i2c_board_info));
86
- strlcpy(info.type, type, I2C_NAME_SIZE);
77
+ strscpy(info.type, type, I2C_NAME_SIZE);
8778
8879 /* Our default information for ir-kbd-i2c.c to use */
8980 switch (hw) {
....@@ -97,7 +88,7 @@
9788 break;
9889 }
9990
100
- return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ?
91
+ return IS_ERR(i2c_new_scanned_device(adap, &info, addr_list, NULL)) ?
10192 -1 : 0;
10293 }
10394