diff options
author | Jinjie Ruan <ruanjinjie@huawei.com> | 2023-10-07 19:38:32 +0800 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2023-10-13 11:33:22 +0200 |
commit | 8cd08e365153481065eeec684ed00949bc980aff (patch) | |
tree | 893e248d2d8ab9492703dc327c9847c1d19a28ea /drivers/i2c/i2c-dev.c | |
parent | 19e2e01f30b5d2b448b5db097130486ea95af36f (diff) | |
download | linux-stable-8cd08e365153481065eeec684ed00949bc980aff.tar.gz linux-stable-8cd08e365153481065eeec684ed00949bc980aff.tar.bz2 linux-stable-8cd08e365153481065eeec684ed00949bc980aff.zip |
media: siano: Drop unnecessary error check for debugfs_create_dir/file()
Both debugfs_create_dir() and debugfs_create_file() return ERR_PTR
and never return NULL.
As Hans suggested, this patch removes the error checking for both
debugfs_create_dir() and debugfs_create_file() in smsdvb_debugfs_create().
This is because the DebugFS kernel API is developed in a way that the
caller can safely ignore the errors that occur during the creation of
DebugFS nodes. The debugfs APIs have a IS_ERR() judge in start_creating()
which can handle it gracefully. So these checks are unnecessary.
And as Hans pointed out, it's much better to first allocate debug_data
before calling debugfs_create_dir, which need not to clean anything up in
that case.
Fixes: 503efe5cfc9f ("[media] siano: split debugfs code into a separate file")
Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com>
Suggested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Diffstat (limited to 'drivers/i2c/i2c-dev.c')
0 files changed, 0 insertions, 0 deletions