Commit 39dc3aae authored by Jaejoong Kim's avatar Jaejoong Kim Committed by Mauro Carvalho Chehab

[media] uvcvideo: Change result code of debugfs_init to void

The device driver should keep going even if debugfs initialization fails.
So, change the return type to void.
Signed-off-by: default avatarJaejoong Kim <climbbb.kim@gmail.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@s-opensource.com>
parent 17c341ec
...@@ -75,14 +75,14 @@ static const struct file_operations uvc_debugfs_stats_fops = { ...@@ -75,14 +75,14 @@ static const struct file_operations uvc_debugfs_stats_fops = {
static struct dentry *uvc_debugfs_root_dir; static struct dentry *uvc_debugfs_root_dir;
int uvc_debugfs_init_stream(struct uvc_streaming *stream) void uvc_debugfs_init_stream(struct uvc_streaming *stream)
{ {
struct usb_device *udev = stream->dev->udev; struct usb_device *udev = stream->dev->udev;
struct dentry *dent; struct dentry *dent;
char dir_name[32]; char dir_name[32];
if (uvc_debugfs_root_dir == NULL) if (uvc_debugfs_root_dir == NULL)
return -ENODEV; return;
sprintf(dir_name, "%u-%u", udev->bus->busnum, udev->devnum); sprintf(dir_name, "%u-%u", udev->bus->busnum, udev->devnum);
...@@ -90,7 +90,7 @@ int uvc_debugfs_init_stream(struct uvc_streaming *stream) ...@@ -90,7 +90,7 @@ int uvc_debugfs_init_stream(struct uvc_streaming *stream)
if (IS_ERR_OR_NULL(dent)) { if (IS_ERR_OR_NULL(dent)) {
uvc_printk(KERN_INFO, "Unable to create debugfs %s " uvc_printk(KERN_INFO, "Unable to create debugfs %s "
"directory.\n", dir_name); "directory.\n", dir_name);
return -ENODEV; return;
} }
stream->debugfs_dir = dent; stream->debugfs_dir = dent;
...@@ -100,10 +100,8 @@ int uvc_debugfs_init_stream(struct uvc_streaming *stream) ...@@ -100,10 +100,8 @@ int uvc_debugfs_init_stream(struct uvc_streaming *stream)
if (IS_ERR_OR_NULL(dent)) { if (IS_ERR_OR_NULL(dent)) {
uvc_printk(KERN_INFO, "Unable to create debugfs stats file.\n"); uvc_printk(KERN_INFO, "Unable to create debugfs stats file.\n");
uvc_debugfs_cleanup_stream(stream); uvc_debugfs_cleanup_stream(stream);
return -ENODEV; return;
} }
return 0;
} }
void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream) void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream)
...@@ -115,18 +113,17 @@ void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream) ...@@ -115,18 +113,17 @@ void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream)
stream->debugfs_dir = NULL; stream->debugfs_dir = NULL;
} }
int uvc_debugfs_init(void) void uvc_debugfs_init(void)
{ {
struct dentry *dir; struct dentry *dir;
dir = debugfs_create_dir("uvcvideo", usb_debug_root); dir = debugfs_create_dir("uvcvideo", usb_debug_root);
if (IS_ERR_OR_NULL(dir)) { if (IS_ERR_OR_NULL(dir)) {
uvc_printk(KERN_INFO, "Unable to create debugfs directory\n"); uvc_printk(KERN_INFO, "Unable to create debugfs directory\n");
return -ENODATA; return;
} }
uvc_debugfs_root_dir = dir; uvc_debugfs_root_dir = dir;
return 0;
} }
void uvc_debugfs_cleanup(void) void uvc_debugfs_cleanup(void)
......
...@@ -757,9 +757,9 @@ void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream, ...@@ -757,9 +757,9 @@ void uvc_video_decode_isight(struct urb *urb, struct uvc_streaming *stream,
struct uvc_buffer *buf); struct uvc_buffer *buf);
/* debugfs and statistics */ /* debugfs and statistics */
int uvc_debugfs_init(void); void uvc_debugfs_init(void);
void uvc_debugfs_cleanup(void); void uvc_debugfs_cleanup(void);
int uvc_debugfs_init_stream(struct uvc_streaming *stream); void uvc_debugfs_init_stream(struct uvc_streaming *stream);
void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream); void uvc_debugfs_cleanup_stream(struct uvc_streaming *stream);
size_t uvc_video_stats_dump(struct uvc_streaming *stream, char *buf, size_t uvc_video_stats_dump(struct uvc_streaming *stream, char *buf,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment