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

soc/tegra: cbb: Drop unnecessary debugfs error handling

Kernel coding style expects all drivers to ignore debugfs errors.
Partially because it is purely for debugging, not for important user
interfaces. Simplify the code by dropping unnecessary probe failuring
and error message on debugfs failures, which also fixes incorrect usage
IS_ERR_OR_NULL() and Smatch warning:

drivers/soc/tegra/cbb/tegra-cbb.c:80 tegra_cbb_err_debugfs_init() warn: passing zero to 'PTR_ERR'

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20250104141958.115911-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Thierry Reding <treding@nvidia.com>

authored by

Krzysztof Kozlowski and committed by
Thierry Reding
74d4d7c6 40384c84

+4 -16
+4 -16
drivers/soc/tegra/cbb/tegra-cbb.c
··· 69 69 } 70 70 DEFINE_SHOW_ATTRIBUTE(tegra_cbb_err); 71 71 72 - static int tegra_cbb_err_debugfs_init(struct tegra_cbb *cbb) 72 + static void tegra_cbb_err_debugfs_init(struct tegra_cbb *cbb) 73 73 { 74 74 static struct dentry *root; 75 75 76 - if (!root) { 76 + if (!root) 77 77 root = debugfs_create_file("tegra_cbb_err", 0444, NULL, cbb, &tegra_cbb_err_fops); 78 - if (IS_ERR_OR_NULL(root)) { 79 - pr_err("%s(): could not create debugfs node\n", __func__); 80 - return PTR_ERR(root); 81 - } 82 - } 83 - 84 - return 0; 85 78 } 86 79 87 80 void tegra_cbb_stall_enable(struct tegra_cbb *cbb) ··· 141 148 { 142 149 int ret; 143 150 144 - if (IS_ENABLED(CONFIG_DEBUG_FS)) { 145 - ret = tegra_cbb_err_debugfs_init(cbb); 146 - if (ret) { 147 - dev_err(cbb->dev, "failed to create debugfs\n"); 148 - return ret; 149 - } 150 - } 151 + if (IS_ENABLED(CONFIG_DEBUG_FS)) 152 + tegra_cbb_err_debugfs_init(cbb); 151 153 152 154 /* register interrupt handler for errors due to different initiators */ 153 155 ret = cbb->ops->interrupt_enable(cbb);