-
Notifications
You must be signed in to change notification settings - Fork 6.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add few shell filters #84179
base: main
Are you sure you want to change the base?
Add few shell filters #84179
Conversation
drivers/dac/dac_shell.c
Outdated
@@ -94,14 +94,31 @@ static int cmd_write_value(const struct shell *sh, size_t argc, char **argv) | |||
return 0; | |||
} | |||
|
|||
static bool device_is_dac(const struct device *dev) | |||
{ | |||
return device_is_ready(dev) && DEVICE_API_IS(dac, dev); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
shell_device_filter already checks device_is_ready so this is superfluous
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey you are right! I had copy pasted this from other drivers, removed from all of these and added an extra patch to clean up the existing ones. Thanks!
Add shell device name filtering using DEVICE_API_IS. Signed-off-by: Fabio Baltieri <[email protected]>
Add shell device name filtering using DEVICE_API_IS. Signed-off-by: Fabio Baltieri <[email protected]>
Add shell device name filtering using DEVICE_API_IS. Signed-off-by: Fabio Baltieri <[email protected]>
Drop few redundant device_is_ready for functions that are only used as argument to shell_device_filter, as shell_device_filter checks for that alrady. Suggested-by: Yishai Jaffe <[email protected]> Signed-off-by: Fabio Baltieri <[email protected]>
705c71e
Add few shell filter functions, i2c, regulator and dac.