pinctrl: nomadik: Use string_choices API instead of ternary operator
Subsystems (3)
PATCH 1/1 pinctrl: nomadik: Use string_choices API instead of ternary operator
Use modern string_choices API instead of manually determining the output using ternary operator.
--- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/pinctrl/nomadik/pinctrl-nomadik.c +5 -5
@@ -28,6 +28,7 @@#include <linux/seq_file.h> #include <linux/slab.h> #include <linux/spinlock.h> +#include <linux/string_choices.h> #include <linux/types.h> /* Since we request GPIOs from ourself */
@@ -1105,17 +1106,16 @@ static int nmk_pin_config_set(struct pinctrl_dev *pctldev, unsigned int pin,"pin %d: sleep pull %s, dir %s, val %s\n" , pin, slpm_pull ? pullnames[pull] :"same" , - slpm_output ? (output ?"output" :"input" ) - :"same" , - slpm_val ? (val ? "high" : "low") : "same"); + slpm_output ? (output ?"output" :"input" ) :"same" , + slpm_val ? str_high_low(val) : "same"); }dev_dbg (nmk_chip->chip.parent,"pin %d [%#lx]: pull %s, slpm %s (%s%s), lowemi %s\n" , pin, cfg, pullnames[pull], slpmnames[slpm], output ?"output " :"input" , - output ? (val ?"high" :"low" ) :"" , - lowemi ?"on" :"off" ); + output ?str_high_low (val) :"" , +str_on_off (lowemi));clk_enable (nmk_chip->clk);if (gpiomode)
Signature · 1 line
2.43.0.rc1.1336.g36b5255a03ac
Quoted 2 lines · Andy Shevchenko
Use modern
string_choicesAPI instead of manually determining the output using ternary operator.
Linus, do you have any comment on this?
I had sent two patches of similar changes (different drivers, thoug), one got applied and this is not. Anything should I do about it?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 9 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko
Use modern
string_choicesAPI instead of manually determining the output using ternary operator.Linus, do you have any comment on this?
I had sent two patches of similar changes (different drivers, thoug), one got applied and this is not. Anything should I do about it?
Sorry for late reply :(
I thought it looks weird to replace just one string choice in the middle of everything and it will be confusing for readers? They will be "but what is this now, this looks weird".
Yours,
Linus Walleij
Quoted 9 lines · Linus Walleij
Quoted 7 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko
Use modern
string_choicesAPI instead of manually determining the output using ternary operator.Linus, do you have any comment on this?
Quoted 8 lines
Quoted 2 lines
I had sent two patches of similar changes (different drivers, thoug), one got applied and this is not. Anything should I do about it?
Sorry for late reply :(
I thought it looks weird to replace just one string choice in the middle of everything and it will be confusing for readers? They will be "but what is this now, this looks weird".
Do you mean it's incomplete? So, i.o.w., if we have str_output_input() it will go?
Signature · 2 lines
With Best Regards, Andy Shevchenko
Quoted 13 lines · Andy Shevchenko
Quoted 12 lines · Linus Walleij
Quoted 9 lines · Andy Shevchenko
Quoted 2 lines · Andy Shevchenko
Use modern
string_choicesAPI instead of manually determining the output using ternary operator.Linus, do you have any comment on this?
I had sent two patches of similar changes (different drivers, thoug), one got applied and this is not. Anything should I do about it?
Quoted 8 lines
Quoted 5 lines
Sorry for late reply :(
I thought it looks weird to replace just one string choice in the middle of everything and it will be confusing for readers? They will be "but what is this now, this looks weird".
Do you mean it's incomplete? So, i.o.w., if we have
str_output_input()it will go?
Yeps it looks half-way otherwise.
I wasn't a big fan of the choices but no strong feelings about it either so as long as it's consistent I will be OK with it.
Yours,
Linus Walleij