hc
2023-12-11 d2ccde1c8e90d38cee87a1b0309ad2827f3fd30d
kernel/drivers/media/pci/ivtv/ivtv-i2c.c
....@@ -1,21 +1,9 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 I2C functions
34 Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com>
45 Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl>
56
6
- This program is free software; you can redistribute it and/or modify
7
- it under the terms of the GNU General Public License as published by
8
- the Free Software Foundation; either version 2 of the License, or
9
- (at your option) any later version.
10
-
11
- This program is distributed in the hope that it will be useful,
12
- but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- GNU General Public License for more details.
15
-
16
- You should have received a copy of the GNU General Public License
17
- along with this program; if not, write to the Free Software
18
- Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
197 */
208
219 /*
....@@ -218,14 +206,14 @@
218206
219207 memset(&info, 0, sizeof(struct i2c_board_info));
220208 info.platform_data = init_data;
221
- strlcpy(info.type, type, I2C_NAME_SIZE);
209
+ strscpy(info.type, type, I2C_NAME_SIZE);
222210
223
- return i2c_new_probed_device(adap, &info, addr_list, NULL) == NULL ?
211
+ return IS_ERR(i2c_new_scanned_device(adap, &info, addr_list, NULL)) ?
224212 -1 : 0;
225213 }
226214
227215 /* Instantiate the IR receiver device using probing -- undesirable */
228
-struct i2c_client *ivtv_i2c_new_ir_legacy(struct ivtv *itv)
216
+void ivtv_i2c_new_ir_legacy(struct ivtv *itv)
229217 {
230218 struct i2c_board_info info;
231219 /*
....@@ -239,15 +227,15 @@
239227 * allocations, so this function must be called after all other i2c
240228 * devices we care about are registered.
241229 */
242
- const unsigned short addr_list[] = {
230
+ static const unsigned short addr_list[] = {
243231 0x1a, /* Hauppauge IR external - collides with WM8739 */
244232 0x18, /* Hauppauge IR internal */
245233 I2C_CLIENT_END
246234 };
247235
248236 memset(&info, 0, sizeof(struct i2c_board_info));
249
- strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
250
- return i2c_new_probed_device(&itv->i2c_adap, &info, addr_list, NULL);
237
+ strscpy(info.type, "ir_video", I2C_NAME_SIZE);
238
+ i2c_new_scanned_device(&itv->i2c_adap, &info, addr_list, NULL);
251239 }
252240
253241 int ivtv_i2c_register(struct ivtv *itv, unsigned idx)