Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

HSI: omap-ssi: Remove unnecessary debugfs_create_dir() error check

Remove the debugfs_create_dir() error check. It's safe to pass in error
pointers to the debugfs API, hence the user isn't supposed to include
error checking of the return values.

Signed-off-by: Yang Ruibin <11162571@vivo.com>
Link: https://lore.kernel.org/r/20240827120816.3910198-1-11162571@vivo.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>

authored by

Yang Ruibin and committed by
Sebastian Reichel
c3eddf5e 8400291e

+1 -10
+1 -10
drivers/hsi/controllers/omap_ssi_core.c
··· 116 116 117 117 /* SSI controller */ 118 118 omap_ssi->dir = debugfs_create_dir(dev_name(&ssi->device), NULL); 119 - if (!omap_ssi->dir) 120 - return -ENOMEM; 119 + debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi, &ssi_regs_fops); 121 120 122 - debugfs_create_file("regs", S_IRUGO, omap_ssi->dir, ssi, 123 - &ssi_regs_fops); 124 121 /* SSI GDD (DMA) */ 125 122 dir = debugfs_create_dir("gdd", omap_ssi->dir); 126 - if (!dir) 127 - goto rback; 128 123 debugfs_create_file("regs", S_IRUGO, dir, ssi, &ssi_gdd_regs_fops); 129 124 130 125 return 0; 131 - rback: 132 - debugfs_remove_recursive(omap_ssi->dir); 133 - 134 - return -ENOMEM; 135 126 } 136 127 137 128 static void ssi_debug_remove_ctrl(struct hsi_controller *ssi)