Skip to content

Commit 32ec99f

Browse files
ruanjinjie-engHans Verkuil
authored andcommitted
media: aspeed: Drop unnecessary error check for debugfs_create_file()
debugfs_create_file() return ERR_PTR and never return NULL. 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. Fixes: 52fed10 ("media: aspeed: add debugfs") Signed-off-by: Jinjie Ruan <ruanjinjie@huawei.com> Suggested-by: Hans Verkuil <hverkuil-cisco@xs4all.nl> Reviewed-by: Eddie James <eajames@linux.ibm.com> Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
1 parent faaed02 commit 32ec99f

1 file changed

Lines changed: 3 additions & 12 deletions

File tree

drivers/media/platform/aspeed/aspeed-video.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1970,22 +1970,15 @@ static void aspeed_video_debugfs_remove(struct aspeed_video *video)
19701970
debugfs_entry = NULL;
19711971
}
19721972

1973-
static int aspeed_video_debugfs_create(struct aspeed_video *video)
1973+
static void aspeed_video_debugfs_create(struct aspeed_video *video)
19741974
{
19751975
debugfs_entry = debugfs_create_file(DEVICE_NAME, 0444, NULL,
19761976
video,
19771977
&aspeed_video_debugfs_fops);
1978-
if (!debugfs_entry)
1979-
aspeed_video_debugfs_remove(video);
1980-
1981-
return !debugfs_entry ? -EIO : 0;
19821978
}
19831979
#else
19841980
static void aspeed_video_debugfs_remove(struct aspeed_video *video) { }
1985-
static int aspeed_video_debugfs_create(struct aspeed_video *video)
1986-
{
1987-
return 0;
1988-
}
1981+
static void aspeed_video_debugfs_create(struct aspeed_video *video) { }
19891982
#endif /* CONFIG_DEBUG_FS */
19901983

19911984
static int aspeed_video_setup_video(struct aspeed_video *video)
@@ -2198,9 +2191,7 @@ static int aspeed_video_probe(struct platform_device *pdev)
21982191
return rc;
21992192
}
22002193

2201-
rc = aspeed_video_debugfs_create(video);
2202-
if (rc)
2203-
dev_err(video->dev, "debugfs create failed\n");
2194+
aspeed_video_debugfs_create(video);
22042195

22052196
return 0;
22062197
}

0 commit comments

Comments
 (0)