| .. | .. |
|---|
| 1 | +// SPDX-License-Identifier: GPL-2.0-only |
|---|
| 1 | 2 | /* |
|---|
| 2 | 3 | * drivers/media/i2c/lm3646.c |
|---|
| 3 | 4 | * General device driver for TI lm3646, Dual FLASH LED Driver |
|---|
| .. | .. |
|---|
| 6 | 7 | * |
|---|
| 7 | 8 | * Contact: Daniel Jeong <gshark.jeong@gmail.com> |
|---|
| 8 | 9 | * 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. |
|---|
| 13 | 10 | */ |
|---|
| 14 | 11 | |
|---|
| 15 | 12 | #include <linux/delay.h> |
|---|
| .. | .. |
|---|
| 62 | 59 | * @regmap: reg. map for i2c |
|---|
| 63 | 60 | * @lock: muxtex for serial access. |
|---|
| 64 | 61 | * @led_mode: V4L2 LED mode |
|---|
| 65 | | - * @ctrls_led: V4L2 contols |
|---|
| 62 | + * @ctrls_led: V4L2 controls |
|---|
| 66 | 63 | * @subdev_led: V4L2 subdev |
|---|
| 67 | 64 | * @mode_reg : mode register value |
|---|
| 68 | 65 | */ |
|---|
| .. | .. |
|---|
| 137 | 134 | { |
|---|
| 138 | 135 | struct lm3646_flash *flash = to_lm3646_flash(ctrl); |
|---|
| 139 | 136 | unsigned int reg_val; |
|---|
| 140 | | - int rval = -EINVAL; |
|---|
| 137 | + int rval; |
|---|
| 141 | 138 | |
|---|
| 142 | 139 | switch (ctrl->id) { |
|---|
| 143 | 140 | case V4L2_CID_FLASH_LED_MODE: |
|---|
| .. | .. |
|---|
| 278 | 275 | |
|---|
| 279 | 276 | v4l2_i2c_subdev_init(&flash->subdev_led, client, &lm3646_ops); |
|---|
| 280 | 277 | 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)); |
|---|
| 282 | 280 | rval = lm3646_init_controls(flash); |
|---|
| 283 | 281 | if (rval) |
|---|
| 284 | 282 | goto err_out; |
|---|