mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 02:30:34 +02:00 
			
		
		
		
	pwm: gpio: Switch to use hrtimer_setup()
hrtimer_setup() takes the callback function pointer as argument and initializes the timer completely. Replace hrtimer_init() and the open coded initialization of hrtimer::function with the new setup mechanism. Acked-by: Zack Rusin <zack.rusin@broadcom.com> Signed-off-by: Nam Cao <namcao@linutronix.de> Link: https://lore.kernel.org/r/7b7115da84372a49e36a0ac1a5ce553129c3ce0b.1738746904.git.namcao@linutronix.de Signed-off-by: Uwe Kleine-König <ukleinek@kernel.org>
This commit is contained in:
		
							parent
							
								
									c98e66144b
								
							
						
					
					
						commit
						e320a24059
					
				
					 1 changed files with 2 additions and 3 deletions
				
			
		| 
						 | 
					@ -207,13 +207,12 @@ static int pwm_gpio_probe(struct platform_device *pdev)
 | 
				
			||||||
	chip->ops = &pwm_gpio_ops;
 | 
						chip->ops = &pwm_gpio_ops;
 | 
				
			||||||
	chip->atomic = true;
 | 
						chip->atomic = true;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	hrtimer_init(&gpwm->gpio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 | 
						hrtimer_setup(&gpwm->gpio_timer, pwm_gpio_timer, CLOCK_MONOTONIC, HRTIMER_MODE_REL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	ret = devm_add_action_or_reset(dev, pwm_gpio_disable_hrtimer, gpwm);
 | 
						ret = devm_add_action_or_reset(dev, pwm_gpio_disable_hrtimer, gpwm);
 | 
				
			||||||
	if (ret)
 | 
						if (ret)
 | 
				
			||||||
		return ret;
 | 
							return ret;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	gpwm->gpio_timer.function = pwm_gpio_timer;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	ret = pwmchip_add(chip);
 | 
						ret = pwmchip_add(chip);
 | 
				
			||||||
	if (ret < 0)
 | 
						if (ret < 0)
 | 
				
			||||||
		return dev_err_probe(dev, ret, "could not add pwmchip\n");
 | 
							return dev_err_probe(dev, ret, "could not add pwmchip\n");
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue