aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/cpia.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/media/video/cpia.c')
-rw-r--r--drivers/media/video/cpia.c13
1 files changed, 4 insertions, 9 deletions
diff --git a/drivers/media/video/cpia.c b/drivers/media/video/cpia.c
index 2377313c041a..d6f2653afb6c 100644
--- a/drivers/media/video/cpia.c
+++ b/drivers/media/video/cpia.c
@@ -1342,15 +1342,13 @@ out:
1342 1342
1343static void create_proc_cpia_cam(struct cam_data *cam) 1343static void create_proc_cpia_cam(struct cam_data *cam)
1344{ 1344{
1345 char name[5 + 1 + 10 + 1];
1346 struct proc_dir_entry *ent; 1345 struct proc_dir_entry *ent;
1347 1346
1348 if (!cpia_proc_root || !cam) 1347 if (!cpia_proc_root || !cam)
1349 return; 1348 return;
1350 1349
1351 snprintf(name, sizeof(name), "video%d", cam->vdev.num); 1350 ent = create_proc_entry(video_device_node_name(&cam->vdev),
1352 1351 S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
1353 ent = create_proc_entry(name, S_IFREG|S_IRUGO|S_IWUSR, cpia_proc_root);
1354 if (!ent) 1352 if (!ent)
1355 return; 1353 return;
1356 1354
@@ -1368,13 +1366,10 @@ static void create_proc_cpia_cam(struct cam_data *cam)
1368 1366
1369static void destroy_proc_cpia_cam(struct cam_data *cam) 1367static void destroy_proc_cpia_cam(struct cam_data *cam)
1370{ 1368{
1371 char name[5 + 1 + 10 + 1];
1372
1373 if (!cam || !cam->proc_entry) 1369 if (!cam || !cam->proc_entry)
1374 return; 1370 return;
1375 1371
1376 snprintf(name, sizeof(name), "video%d", cam->vdev.num); 1372 remove_proc_entry(video_device_node_name(&cam->vdev), cpia_proc_root);
1377 remove_proc_entry(name, cpia_proc_root);
1378 cam->proc_entry = NULL; 1373 cam->proc_entry = NULL;
1379} 1374}
1380 1375
@@ -3999,7 +3994,7 @@ void cpia_unregister_camera(struct cam_data *cam)
3999 } 3994 }
4000 3995
4001#ifdef CONFIG_PROC_FS 3996#ifdef CONFIG_PROC_FS
4002 DBG("destroying /proc/cpia/video%d\n", cam->vdev.num); 3997 DBG("destroying /proc/cpia/%s\n", video_device_node_name(&cam->vdev));
4003 destroy_proc_cpia_cam(cam); 3998 destroy_proc_cpia_cam(cam);
4004#endif 3999#endif
4005 if (!cam->open_count) { 4000 if (!cam->open_count) {