drm: no need to check return value of debugfs_create functions
When calling debugfs functions, there is no need to ever check the return value. The function can work or not, but the code logic should never do something different based on this. Because there is no need to check these functions, a number of local functions can be made to return void to simplify things as nothing can fail. Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Maxime Ripard <maxime.ripard@bootlin.com> Cc: Sean Paul <sean@poorly.run> Cc: David Airlie <airlied@linux.ie> Cc: Daniel Vetter <daniel@ffwll.ch> Cc: dri-devel@lists.freedesktop.org Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: https://patchwork.freedesktop.org/patch/msgid/20190613133439.GA6715@kroah.com
This commit is contained in:

committed by
Daniel Vetter

parent
5b038dcf9d
commit
b792e64021
@@ -351,33 +351,19 @@ static const struct file_operations drm_crtc_crc_data_fops = {
|
||||
.release = crtc_crc_release,
|
||||
};
|
||||
|
||||
int drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
|
||||
void drm_debugfs_crtc_crc_add(struct drm_crtc *crtc)
|
||||
{
|
||||
struct dentry *crc_ent, *ent;
|
||||
struct dentry *crc_ent;
|
||||
|
||||
if (!crtc->funcs->set_crc_source || !crtc->funcs->verify_crc_source)
|
||||
return 0;
|
||||
return;
|
||||
|
||||
crc_ent = debugfs_create_dir("crc", crtc->debugfs_entry);
|
||||
if (!crc_ent)
|
||||
return -ENOMEM;
|
||||
|
||||
ent = debugfs_create_file("control", S_IRUGO, crc_ent, crtc,
|
||||
&drm_crtc_crc_control_fops);
|
||||
if (!ent)
|
||||
goto error;
|
||||
|
||||
ent = debugfs_create_file("data", S_IRUGO, crc_ent, crtc,
|
||||
&drm_crtc_crc_data_fops);
|
||||
if (!ent)
|
||||
goto error;
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
debugfs_remove_recursive(crc_ent);
|
||||
|
||||
return -ENOMEM;
|
||||
debugfs_create_file("control", S_IRUGO, crc_ent, crtc,
|
||||
&drm_crtc_crc_control_fops);
|
||||
debugfs_create_file("data", S_IRUGO, crc_ent, crtc,
|
||||
&drm_crtc_crc_data_fops);
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user