drivers: pinctrl_nrf: Fix disconnecting of pins
This is a follow-up to commit 223cc3c6. When a peripheral pin is disconnected, the pinctrl driver should skip applying of GPIO configuration, as there is no pin number available in such case, but due to an incorrect check, it actually did not skip it and used an incorrect pin number for that. In nrfx prior to 3.0.0, this caused an assertion failure, but because of a fallback routine, things could still work in most cases (when assertions were disabled) as that GPIO configuration was just applied to P0.31. Hence the bug was not discovered until now. In the recent nrfx, this causes a null pointer dereference, so always a crash. This commit corrects the mentioned check and also uses the term "psel" instead of "pin" where it is possible that the value is not a correct pin number, in the hope of preventing a similar problem in the future. Signed-off-by:Andrzej Głąbek <andrzej.glabek@nordicsemi.no>
Loading
Please sign in to comment