pinctrl: Use of_property_present() for non-boolean properties
The use of of_property_read_bool() for non-boolean properties is deprecated in favor of of_property_present() when testing for property presence. Signed-off-by: Rob Herring (Arm) <robh@kernel.org> Link: https://lore.kernel.org/20241104194437.327430-1-robh@kernel.org Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
This commit is contained in:
committed by
Linus Walleij
parent
546ee7b890
commit
86db3f0dfa
@@ -633,11 +633,11 @@ static int imx_pinctrl_parse_functions(struct device_node *np,
|
||||
static bool imx_pinctrl_dt_is_flat_functions(struct device_node *np)
|
||||
{
|
||||
for_each_child_of_node_scoped(np, function_np) {
|
||||
if (of_property_read_bool(function_np, "fsl,pins"))
|
||||
if (of_property_present(function_np, "fsl,pins"))
|
||||
return true;
|
||||
|
||||
for_each_child_of_node_scoped(function_np, pinctrl_np) {
|
||||
if (of_property_read_bool(pinctrl_np, "fsl,pins"))
|
||||
if (of_property_present(pinctrl_np, "fsl,pins"))
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -746,7 +746,7 @@ int imx_pinctrl_probe(struct platform_device *pdev,
|
||||
if (IS_ERR(ipctl->base))
|
||||
return PTR_ERR(ipctl->base);
|
||||
|
||||
if (of_property_read_bool(dev_np, "fsl,input-sel")) {
|
||||
if (of_property_present(dev_np, "fsl,input-sel")) {
|
||||
np = of_parse_phandle(dev_np, "fsl,input-sel", 0);
|
||||
if (!np) {
|
||||
dev_err(&pdev->dev, "iomuxc fsl,input-sel property not found\n");
|
||||
|
||||
@@ -1524,7 +1524,7 @@ static int pinmux_xway_probe(struct platform_device *pdev)
|
||||
* files which don't set the "gpio-ranges" property or systems that
|
||||
* utilize ACPI the driver has to call gpiochip_add_pin_range().
|
||||
*/
|
||||
if (!of_property_read_bool(pdev->dev.of_node, "gpio-ranges")) {
|
||||
if (!of_property_present(pdev->dev.of_node, "gpio-ranges")) {
|
||||
/* finish with registering the gpio range in pinctrl */
|
||||
xway_gpio_range.npins = xway_chip.ngpio;
|
||||
xway_gpio_range.base = xway_chip.base;
|
||||
|
||||
@@ -1457,7 +1457,7 @@ static int msm_gpio_init(struct msm_pinctrl *pctrl)
|
||||
* files which don't set the "gpio-ranges" property or systems that
|
||||
* utilize ACPI the driver has to call gpiochip_add_pin_range().
|
||||
*/
|
||||
if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
|
||||
if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
|
||||
ret = gpiochip_add_pin_range(&pctrl->chip,
|
||||
dev_name(pctrl->dev), 0, 0, chip->ngpio);
|
||||
if (ret) {
|
||||
|
||||
@@ -1169,7 +1169,7 @@ static int pmic_gpio_probe(struct platform_device *pdev)
|
||||
* files which don't set the "gpio-ranges" property or systems that
|
||||
* utilize ACPI the driver has to call gpiochip_add_pin_range().
|
||||
*/
|
||||
if (!of_property_read_bool(dev->of_node, "gpio-ranges")) {
|
||||
if (!of_property_present(dev->of_node, "gpio-ranges")) {
|
||||
ret = gpiochip_add_pin_range(&state->chip, dev_name(dev), 0, 0,
|
||||
npins);
|
||||
if (ret) {
|
||||
|
||||
@@ -832,7 +832,7 @@ static int pm8xxx_gpio_probe(struct platform_device *pdev)
|
||||
* files which don't set the "gpio-ranges" property or systems that
|
||||
* utilize ACPI the driver has to call gpiochip_add_pin_range().
|
||||
*/
|
||||
if (!of_property_read_bool(pctrl->dev->of_node, "gpio-ranges")) {
|
||||
if (!of_property_present(pctrl->dev->of_node, "gpio-ranges")) {
|
||||
ret = gpiochip_add_pin_range(&pctrl->chip, dev_name(pctrl->dev),
|
||||
0, 0, pctrl->chip.ngpio);
|
||||
if (ret) {
|
||||
|
||||
Reference in New Issue
Block a user