diff options
Diffstat (limited to 'drivers/media/video/tegra/dw9718.c')
-rw-r--r-- | drivers/media/video/tegra/dw9718.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/video/tegra/dw9718.c b/drivers/media/video/tegra/dw9718.c index b8a5988acd71..9557a5b0b1b2 100644 --- a/drivers/media/video/tegra/dw9718.c +++ b/drivers/media/video/tegra/dw9718.c @@ -127,6 +127,7 @@ struct dw9718_info { int status; u32 cur_pos; u8 s_mode; + char devname[16]; }; /** @@ -878,7 +879,6 @@ static int dw9718_probe( const struct i2c_device_id *id) { struct dw9718_info *info; - char dname[16]; int err; dev_dbg(&client->dev, "%s\n", __func__); pr_info("dw9718: probing focuser.\n"); @@ -929,20 +929,21 @@ static int dw9718_probe( } if (info->pdata->dev_name != 0) - strcpy(dname, info->pdata->dev_name); + strncpy(info->devname, info->pdata->dev_name, + sizeof(info->devname) - 1); else - strcpy(dname, "dw9718"); + strncpy(info->devname, "dw9718", sizeof(info->devname) - 1); if (info->pdata->num) - snprintf(dname, sizeof(dname), - "%s.%u", dname, info->pdata->num); + snprintf(info->devname, sizeof(info->devname), + "%s.%u", info->devname, info->pdata->num); - info->miscdev.name = dname; + info->miscdev.name = info->devname; info->miscdev.fops = &dw9718_fileops; info->miscdev.minor = MISC_DYNAMIC_MINOR; if (misc_register(&info->miscdev)) { dev_err(&client->dev, "%s unable to register misc device %s\n", - __func__, dname); + __func__, info->devname); dw9718_del(info); return -ENODEV; } |