diff options
author | Jinjie Ruan <[email protected]> | 2023-08-21 11:29:14 +0800 |
---|---|---|
committer | Wolfram Sang <[email protected]> | 2023-08-26 00:18:39 +0200 |
commit | c8930ed073951105bf42c4b1d3b9520aa83debfa (patch) | |
tree | 2b4cc87c71e57fff499c63007219a29cf7bc7603 /net/unix/sysctl_net_unix.c | |
parent | 4ba63869a0f539c1b8d5027ccf2295c23d66fa54 (diff) |
i2c: Make return value check more accurate and explicit for devm_pinctrl_get()
If pinctrl is not available (thus devm_pinctrl_get() returns NULL) then
recovery can't work, because we can't switch the I2C pins between the
I2C controller and GPIO. So, it is quite correct to print
"can't get pinctrl, bus recovery not supported" because the I2C bus
can't be recovered without pinctrl.
The PTR_ERR() is also fine - because if pinctrl is not present and
returns NULL, we'll end up returning zero, which is exactly what we
want.
However, open code that with a more accurate message will be more explicit
for NULL case when CONFIG_PINCTRL is not defined.
Signed-off-by: Jinjie Ruan <[email protected]>
Acked-by: Oleksij Rempel <[email protected]>
Reviewed-by: Linus Walleij <[email protected]>
Acked-by: Nicolas Ferre <[email protected]>
Suggested-by: Russell King (Oracle) <[email protected]>
Reviewed-by: Andi Shyti <[email protected]>
Signed-off-by: Wolfram Sang <[email protected]>
Diffstat (limited to 'net/unix/sysctl_net_unix.c')
0 files changed, 0 insertions, 0 deletions