[PATCH 6/7] featctrl: drop useless NULL check

Ahmad Fatoum ahmad at a3f.at
Mon Apr 24 05:18:04 PDT 2023


The only instance of calling featctrl_get_from_provider looks like this:

  featctrl = featctrl_get_from_provider(&featctrl_args, &gateid);

Given that the function is static, there's no need to protect against
either argument being NULL, so drop the check.

Signed-off-by: Ahmad Fatoum <ahmad at a3f.at>
---
 drivers/base/featctrl.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/drivers/base/featctrl.c b/drivers/base/featctrl.c
index f40b1f04bc1f..0b81f801058d 100644
--- a/drivers/base/featctrl.c
+++ b/drivers/base/featctrl.c
@@ -46,9 +46,6 @@ static struct feature_controller *featctrl_get_from_provider(struct of_phandle_a
 	struct feature_controller *featctrl;
 	int ret;
 
-	if (!spec)
-		return ERR_PTR(-EINVAL);
-
 	ret = of_device_ensure_probed(spec->np);
 	if (ret < 0)
 		return ERR_PTR(ret);
-- 
2.38.4




More information about the barebox mailing list