22 Jan
2024
22 Jan
'24
2:14 p.m.
On 17/01/2024 12:26, Philipp Zabel wrote:
On Fr, 2024-01-12 at 17:36 +0100, Krzysztof Kozlowski wrote: [...]
struct reset_control * __of_reset_control_get(struct device_node *node, const char *id, int index, bool shared, bool optional, bool acquired) {
- struct of_phandle_args args = {0};
- bool gpio_fallback = false; struct reset_control *rstc;
- struct reset_controller_dev *r, *rcdev;
- struct of_phandle_args args;
- struct reset_controller_dev *rcdev; int rstc_id; int ret;
@@ -839,39 +1028,49 @@ __of_reset_control_get(struct device_node *node, const char *id, int index, index, &args); if (ret == -EINVAL) return ERR_PTR(ret);
- if (ret)
return optional ? NULL : ERR_PTR(ret);
- if (ret) {
I think this should continue to return optional ? NULL : ERR_PTR(ret) if !IS_ENABLED(CONFIG_RESET_GPIO), for example by just skipping the of_parse_phandle_with_args(). That should allow the GPIO fallback in patch 5 to work as expected.
ack
Best regards, Krzysztof