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

mmc: sdhci-s3c: Replace deprecated of_get_named_gpio()

It seems the of_get_named_gpio() is solely used to check
if the GPIO is present in DT as the function can return 0
if and only if it's present and it becomes in the global
number space 0. But this quite likely shows that the code
wasn't ever been tested on the systems when no GPIO is provided.
In any case, the proper test is just to call of_property_present()
without any attempts in requesting GPIO (as we haven't saved the
number or descriptor anywhere in the code).

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Adrian Hunter <adrian.hunter@intel.com>
Link: https://lore.kernel.org/r/20240307121912.3676850-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>

authored by

Andy Shevchenko and committed by
Ulf Hansson
0c997105 de11e193

+1 -3
+1 -3
drivers/mmc/host/sdhci-s3c.c
··· 17 17 #include <linux/slab.h> 18 18 #include <linux/clk.h> 19 19 #include <linux/io.h> 20 - #include <linux/gpio.h> 21 20 #include <linux/module.h> 22 21 #include <linux/of.h> 23 - #include <linux/of_gpio.h> 24 22 #include <linux/pm.h> 25 23 #include <linux/pm_runtime.h> 26 24 ··· 444 446 return 0; 445 447 } 446 448 447 - if (of_get_named_gpio(node, "cd-gpios", 0)) 449 + if (of_property_present(node, "cd-gpios")) 448 450 return 0; 449 451 450 452 /* assuming internal card detect that will be configured by pinctrl */