forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/pci/cx23885/cx23885-i2c.c
....@@ -1,24 +1,13 @@
1
+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * Driver for the Conexant CX23885 PCIe bridge
34 *
45 * Copyright (c) 2006 Steven Toth <stoth@linuxtv.org>
5
- *
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
- *
15
- * GNU General Public License for more details.
166 */
177
188 #include "cx23885.h"
199
2010 #include <linux/module.h>
21
-#include <linux/moduleparam.h>
2211 #include <linux/init.h>
2312 #include <linux/delay.h>
2413 #include <asm/io.h>
....@@ -317,7 +306,7 @@
317306 bus->i2c_client = cx23885_i2c_client_template;
318307 bus->i2c_adap.dev.parent = &dev->pci->dev;
319308
320
- strlcpy(bus->i2c_adap.name, bus->dev->name,
309
+ strscpy(bus->i2c_adap.name, bus->dev->name,
321310 sizeof(bus->i2c_adap.name));
322311
323312 bus->i2c_adap.algo_data = bus;
....@@ -340,16 +329,16 @@
340329 /* Instantiate the IR receiver device, if present */
341330 if (0 == bus->i2c_rc) {
342331 struct i2c_board_info info;
343
- const unsigned short addr_list[] = {
332
+ static const unsigned short addr_list[] = {
344333 0x6b, I2C_CLIENT_END
345334 };
346335
347336 memset(&info, 0, sizeof(struct i2c_board_info));
348
- strlcpy(info.type, "ir_video", I2C_NAME_SIZE);
337
+ strscpy(info.type, "ir_video", I2C_NAME_SIZE);
349338 /* Use quick read command for probe, some IR chips don't
350339 * support writes */
351
- i2c_new_probed_device(&bus->i2c_adap, &info, addr_list,
352
- i2c_probe_func_quick_read);
340
+ i2c_new_scanned_device(&bus->i2c_adap, &info, addr_list,
341
+ i2c_probe_func_quick_read);
353342 }
354343
355344 return bus->i2c_rc;