Skip to content

Commit

Permalink
pinctrl: Return -ENOSYS when system call is not available
Browse files Browse the repository at this point in the history
Update the code to use -ENOSYS, which is the correct error code for an
unimplemented system call in U-Boot.

Also we should not check for a missing operations array as this is not
permitted. For now this can be covered by an assert().

Signed-off-by: Simon Glass <[email protected]>
  • Loading branch information
sjg20 committed Apr 6, 2021
1 parent d6332d5 commit bddac45
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions drivers/pinctrl/pinctrl-uclass.c
Original file line number Diff line number Diff line change
Expand Up @@ -235,8 +235,9 @@ int pinctrl_gpio_request(struct udevice *dev, unsigned offset)
return ret;

ops = pinctrl_get_ops(pctldev);
if (!ops || !ops->gpio_request_enable)
return -ENOTSUPP;
assert(ops);
if (!ops->gpio_request_enable)
return -ENOSYS;

return ops->gpio_request_enable(pctldev, pin_selector);
}
Expand All @@ -261,8 +262,9 @@ int pinctrl_gpio_free(struct udevice *dev, unsigned offset)
return ret;

ops = pinctrl_get_ops(pctldev);
if (!ops || !ops->gpio_disable_free)
return -ENOTSUPP;
assert(ops);
if (!ops->gpio_disable_free)
return -ENOSYS;

return ops->gpio_disable_free(pctldev, pin_selector);
}
Expand Down

0 comments on commit bddac45

Please sign in to comment.