forked from ~ljy/RK356X_SDK_RELEASE

hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/media/i2c/lm3646.c
....@@ -1,3 +1,4 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * drivers/media/i2c/lm3646.c
34 * General device driver for TI lm3646, Dual FLASH LED Driver
....@@ -6,10 +7,6 @@
67 *
78 * Contact: Daniel Jeong <gshark.jeong@gmail.com>
89 * Ldd-Mlp <ldd-mlp@list.ti.com>
9
- *
10
- * This program is free software; you can redistribute it and/or
11
- * modify it under the terms of the GNU General Public License
12
- * version 2 as published by the Free Software Foundation.
1310 */
1411
1512 #include <linux/delay.h>
....@@ -62,7 +59,7 @@
6259 * @regmap: reg. map for i2c
6360 * @lock: muxtex for serial access.
6461 * @led_mode: V4L2 LED mode
65
- * @ctrls_led: V4L2 contols
62
+ * @ctrls_led: V4L2 controls
6663 * @subdev_led: V4L2 subdev
6764 * @mode_reg : mode register value
6865 */
....@@ -137,7 +134,7 @@
137134 {
138135 struct lm3646_flash *flash = to_lm3646_flash(ctrl);
139136 unsigned int reg_val;
140
- int rval = -EINVAL;
137
+ int rval;
141138
142139 switch (ctrl->id) {
143140 case V4L2_CID_FLASH_LED_MODE:
....@@ -278,7 +275,8 @@
278275
279276 v4l2_i2c_subdev_init(&flash->subdev_led, client, &lm3646_ops);
280277 flash->subdev_led.flags |= V4L2_SUBDEV_FL_HAS_DEVNODE;
281
- strcpy(flash->subdev_led.name, LM3646_NAME);
278
+ strscpy(flash->subdev_led.name, LM3646_NAME,
279
+ sizeof(flash->subdev_led.name));
282280 rval = lm3646_init_controls(flash);
283281 if (rval)
284282 goto err_out;