.. | .. |
---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-or-later |
---|
1 | 2 | /* |
---|
2 | 3 | I2C functions |
---|
3 | 4 | Copyright (C) 2003-2004 Kevin Thayer <nufan_wfk at yahoo.com> |
---|
4 | 5 | Copyright (C) 2005-2007 Hans Verkuil <hverkuil@xs4all.nl> |
---|
5 | 6 | |
---|
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 |
---|
19 | 7 | */ |
---|
20 | 8 | |
---|
21 | 9 | /* |
---|
.. | .. |
---|
218 | 206 | |
---|
219 | 207 | memset(&info, 0, sizeof(struct i2c_board_info)); |
---|
220 | 208 | info.platform_data = init_data; |
---|
221 | | - strlcpy(info.type, type, I2C_NAME_SIZE); |
---|
| 209 | + strscpy(info.type, type, I2C_NAME_SIZE); |
---|
222 | 210 | |
---|
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)) ? |
---|
224 | 212 | -1 : 0; |
---|
225 | 213 | } |
---|
226 | 214 | |
---|
227 | 215 | /* 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) |
---|
229 | 217 | { |
---|
230 | 218 | struct i2c_board_info info; |
---|
231 | 219 | /* |
---|
.. | .. |
---|
239 | 227 | * allocations, so this function must be called after all other i2c |
---|
240 | 228 | * devices we care about are registered. |
---|
241 | 229 | */ |
---|
242 | | - const unsigned short addr_list[] = { |
---|
| 230 | + static const unsigned short addr_list[] = { |
---|
243 | 231 | 0x1a, /* Hauppauge IR external - collides with WM8739 */ |
---|
244 | 232 | 0x18, /* Hauppauge IR internal */ |
---|
245 | 233 | I2C_CLIENT_END |
---|
246 | 234 | }; |
---|
247 | 235 | |
---|
248 | 236 | 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); |
---|
251 | 239 | } |
---|
252 | 240 | |
---|
253 | 241 | int ivtv_i2c_register(struct ivtv *itv, unsigned idx) |
---|