gpio: sim: Deactivate device in reversed order
PATCH 1/2 gpio: sim: Deactivate device in reversed order
Run the steps to deactivate device in the reserved order to what it has been done in gpio_sim_device_activate_unlocked().
--- drivers/gpio/gpio-sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-sim.c +1 -1
@@ -953,9 +953,9 @@ static void gpio_sim_device_deactivate_unlocked(struct gpio_sim_device *dev) swnode =dev_fwnode (&dev->pdev->dev);platform_device_unregister (dev->pdev); +gpio_sim_remove_hogs (dev);gpio_sim_remove_swnode_recursive (swnode); dev->pdev =NULL ; -gpio_sim_remove_hogs (dev); } static ssize_t
Signature · 1 line
2.39.1
PATCH 2/2 gpio: sim: Print boolean as unsigned integer
Print boolean as unsigned integer instead of using %c and manually converting to a character.
--- drivers/gpio/gpio-sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpio/gpio-sim.c +1 -1
@@ -684,7 +684,7 @@ gpio_sim_device_config_live_show(struct config_item *item, char *page) live =gpio_sim_device_is_live_unlocked (dev);mutex_unlock (&dev->lock); -return sprintf (page,"%c\n" , live ?'1' :'0' ); +return sprintf (page,"%u\n" , live); } static char **gpio_sim_make_line_names(struct gpio_sim_bank *bank,
Signature · 1 line
2.39.1
Re: [PATCH v1 2/2] gpio: sim: Print boolean as unsigned integer
Quoted 23 lines · Andy Shevchenko
Print boolean as unsigned integer instead of using %c and manually converting to a character.
Signed-off-by Andy Shevchenko <[email protected]>--- drivers/gpio/gpio-sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpio/gpio-sim.c +1
-2@@ -684,7 +684,7 @@ gpio_sim_device_config_live_show(struct config_item *item, char *page) live =gpio_sim_device_is_live_unlocked (dev);mutex_unlock (&dev->lock); -return sprintf (page,"%c\n" , live ?'1' :'0' ); +return sprintf (page,"%u\n" , live); } static char **gpio_sim_make_line_names(struct gpio_sim_bank *bank, --
Quoted 2 lines
2.39.1
Sorry but NACK. At first glance the current version is more readable. With the one you're proposing, I need to look at the type of "live" to understand what it will print.
Bart
Quoted 25 lines · Andy Shevchenko
Run the steps to deactivate device in the reserved order to what it has been done in
gpio_sim_device_activate_unlocked().Signed-off-by Andy Shevchenko <[email protected]>--- drivers/gpio/gpio-sim.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/gpio/gpio-sim.c +1
-2@@ -953,9 +953,9 @@ static void gpio_sim_device_deactivate_unlocked(struct gpio_sim_device *dev) swnode =dev_fwnode (&dev->pdev->dev);platform_device_unregister (dev->pdev); +gpio_sim_remove_hogs (dev);gpio_sim_remove_swnode_recursive (swnode); dev->pdev =NULL ; -gpio_sim_remove_hogs (dev); } static ssize_t --
Quoted 2 lines
2.39.1
Meh, doesn't really fix any problem but applied anyway for consistency.
Thanks,
Bart