ret = uclass_get_device_by_ofnode(UCLASS_GPIO, args->node,
&desc->dev);
if (ret) {
-#if CONFIG_IS_ENABLED(MAX77663_GPIO) || CONFIG_IS_ENABLED(PALMAS_GPIO)
- struct udevice *pmic;
- ret = uclass_get_device_by_ofnode(UCLASS_PMIC, args->node,
- &pmic);
- if (ret) {
- log_debug("%s: PMIC device get failed, err %d\n",
- __func__, ret);
- goto err;
- }
-
- device_foreach_child(desc->dev, pmic) {
- if (device_get_uclass_id(desc->dev) == UCLASS_GPIO)
- break;
- }
-
- /* if loop exits without GPIO device return error */
- if (device_get_uclass_id(desc->dev) != UCLASS_GPIO)
- goto err;
-#else
debug("%s: uclass_get_device_by_ofnode failed\n",
__func__);
goto err;
-#endif
}
}
ret = gpio_find_and_xlate(desc, args);