diff options
Diffstat (limited to 'drivers/media/video/tegra/max77387.c')
-rw-r--r-- | drivers/media/video/tegra/max77387.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/drivers/media/video/tegra/max77387.c b/drivers/media/video/tegra/max77387.c index cd9ab5718847..bb0d643e71c2 100644 --- a/drivers/media/video/tegra/max77387.c +++ b/drivers/media/video/tegra/max77387.c @@ -272,6 +272,7 @@ struct max77387_info { u8 ftimer_mode; u8 ttimer_mode; u8 new_timer; + char devname[16]; }; static const struct max77387_caps_struct max77387_caps = { @@ -1725,7 +1726,6 @@ static int max77387_probe( struct i2c_client *client, const struct i2c_device_id *id) { struct max77387_info *info; - char dname[16]; dev_info(&client->dev, "%s\n", __func__); @@ -1777,18 +1777,19 @@ static int max77387_probe( } if (info->pdata->dev_name != NULL) - strncpy(dname, info->pdata->dev_name, sizeof(dname)); + strncpy(info->devname, info->pdata->dev_name, + sizeof(info->devname) - 1); else - strncpy(dname, "max77387", sizeof(dname)); + strncpy(info->devname, "max77387", 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 = &max77387_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); max77387_del(info); return -ENODEV; } |