led: trig: timer: stop offloading on deactivation

Message ID 728da6e11d34a39f717be07e246dcc4964b0fd51.1690542871.git.daniel@makrotopia.org
State New
Headers
Series led: trig: timer: stop offloading on deactivation |

Commit Message

Daniel Golle July 28, 2023, 12:30 p.m. UTC
  Stop hardware blinking when switching from 'timer' to another trigger.

Fixes: 5ada28bf7675 ("led-class: always implement blinking")
Signed-off-by: Daniel Golle <daniel@makrotopia.org>
---
 drivers/leds/trigger/ledtrig-timer.c | 2 ++
 1 file changed, 2 insertions(+)
  

Comments

Pavel Machek July 28, 2023, 1 p.m. UTC | #1
On Fri 2023-07-28 13:30:58, Daniel Golle wrote:
> Stop hardware blinking when switching from 'timer' to another trigger.
> 
> Fixes: 5ada28bf7675 ("led-class: always implement blinking")
> Signed-off-by: Daniel Golle <daniel@makrotopia.org>

ACK.

BR,
								Pavel
  
Lee Jones July 28, 2023, 3:20 p.m. UTC | #2
On Fri, 28 Jul 2023, Pavel Machek wrote:

> On Fri 2023-07-28 13:30:58, Daniel Golle wrote:
> > Stop hardware blinking when switching from 'timer' to another trigger.
> > 
> > Fixes: 5ada28bf7675 ("led-class: always implement blinking")
> > Signed-off-by: Daniel Golle <daniel@makrotopia.org>
> 
> ACK.

Could I have that in full please, such that b4 can pick it up?
  
kernel test robot July 28, 2023, 10:55 p.m. UTC | #3
Hi Daniel,

kernel test robot noticed the following build warnings:

[auto build test WARNING on lee-leds/for-leds-next]
[also build test WARNING on wireless-next/main wireless/main linus/master pavel-leds/for-next v6.5-rc3 next-20230728]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/Daniel-Golle/led-trig-timer-stop-offloading-on-deactivation/20230728-203243
base:   https://git.kernel.org/pub/scm/linux/kernel/git/lee/leds.git for-leds-next
patch link:    https://lore.kernel.org/r/728da6e11d34a39f717be07e246dcc4964b0fd51.1690542871.git.daniel%40makrotopia.org
patch subject: [PATCH] led: trig: timer: stop offloading on deactivation
config: mips-randconfig-r093-20230728 (https://download.01.org/0day-ci/archive/20230729/202307290641.SUCRTRMI-lkp@intel.com/config)
compiler: mips-linux-gcc (GCC) 12.3.0
reproduce: (https://download.01.org/0day-ci/archive/20230729/202307290641.SUCRTRMI-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202307290641.SUCRTRMI-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/leds/trigger/ledtrig-timer.c:129:47: sparse: sparse: Using plain integer as NULL pointer
   drivers/leds/trigger/ledtrig-timer.c:129:50: sparse: sparse: Using plain integer as NULL pointer

vim +129 drivers/leds/trigger/ledtrig-timer.c

   123	
   124	static void timer_trig_deactivate(struct led_classdev *led_cdev)
   125	{
   126		/* Stop blinking */
   127		led_set_brightness(led_cdev, LED_OFF);
   128		if (led_cdev->blink_set)
 > 129			led_cdev->blink_set(led_cdev, 0, 0);
   130	}
   131
  

Patch

diff --git a/drivers/leds/trigger/ledtrig-timer.c b/drivers/leds/trigger/ledtrig-timer.c
index b4688d1d9d2b2..fb6b207b052b8 100644
--- a/drivers/leds/trigger/ledtrig-timer.c
+++ b/drivers/leds/trigger/ledtrig-timer.c
@@ -125,6 +125,8 @@  static void timer_trig_deactivate(struct led_classdev *led_cdev)
 {
 	/* Stop blinking */
 	led_set_brightness(led_cdev, LED_OFF);
+	if (led_cdev->blink_set)
+		led_cdev->blink_set(led_cdev, 0, 0);
 }
 
 static struct led_trigger timer_led_trigger = {