summaryrefslogtreecommitdiff
path: root/drivers/media/video/tegra/ov5693.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/tegra/ov5693.c')
-rw-r--r--drivers/media/video/tegra/ov5693.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/video/tegra/ov5693.c b/drivers/media/video/tegra/ov5693.c
index 9caa165b5041..b1a6e28f4b2e 100644
--- a/drivers/media/video/tegra/ov5693.c
+++ b/drivers/media/video/tegra/ov5693.c
@@ -69,6 +69,7 @@ struct ov5693_info {
struct regmap *regmap;
struct regulator *ext_vcm_vdd;
struct ov5693_cal_data cal;
+ char devname[16];
};
struct ov5693_reg {
@@ -3247,7 +3248,6 @@ static int ov5693_probe(
const struct i2c_device_id *id)
{
struct ov5693_info *info;
- char dname[16];
unsigned long clock_probe_rate;
int err;
static struct regmap_config ad5823_regmap_config = {
@@ -3319,19 +3319,20 @@ static int ov5693_probe(
info->pdata->probe_clock(0);
}
if (info->pdata->dev_name != NULL)
- strcpy(dname, info->pdata->dev_name);
+ strncpy(info->devname, info->pdata->dev_name,
+ sizeof(info->devname) - 1);
else
- strcpy(dname, "ov5693");
+ strncpy(info->devname, "ov5693", sizeof(info->devname) - 1);
if (info->pdata->num)
- snprintf(dname, sizeof(dname), "%s.%u",
- dname, info->pdata->num);
- info->miscdev.name = dname;
+ snprintf(info->devname, sizeof(info->devname), "%s.%u",
+ info->devname, info->pdata->num);
+ info->miscdev.name = info->devname;
info->miscdev.fops = &ov5693_fileops;
info->miscdev.minor = MISC_DYNAMIC_MINOR;
info->miscdev.parent = &client->dev;
if (misc_register(&info->miscdev)) {
dev_err(&client->dev, "%s unable to register misc device %s\n",
- __func__, dname);
+ __func__, info->devname);
ov5693_del(info);
return -ENODEV;
}