Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

pwm: Make pwmchip_[sg]et_drvdata() a wrapper around dev_set_drvdata()

Now that a pwm_chip has a dedicated struct device, pwmchip_set_drvdata()
and pwmchip_get_drvdata() can be made thin wrappers around
dev_set_drvdata() and dev_get_drvdata() respectively and the previously
needed pointer can be dropped from struct pwm_chip.

Link: https://lore.kernel.org/r/a5e05bd2d83421a26fdef6a87d69253c0f98becf.1710670958.git.u.kleine-koenig@pengutronix.de
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

+2 -12
+2 -12
include/linux/pwm.h
··· 274 274 * @of_xlate: request a PWM device given a device tree PWM specifier 275 275 * @atomic: can the driver's ->apply() be called in atomic context 276 276 * @uses_pwmchip_alloc: signals if pwmchip_allow was used to allocate this chip 277 - * @driver_data: Private pointer for driver specific info 278 277 * @pwms: array of PWM devices allocated by the framework 279 278 */ 280 279 struct pwm_chip { ··· 289 290 290 291 /* only used internally by the PWM framework */ 291 292 bool uses_pwmchip_alloc; 292 - void *driver_data; 293 293 struct pwm_device pwms[] __counted_by(npwm); 294 294 }; 295 295 ··· 299 301 300 302 static inline void *pwmchip_get_drvdata(struct pwm_chip *chip) 301 303 { 302 - /* 303 - * After pwm_chip got a dedicated struct device, this can be replaced by 304 - * dev_get_drvdata(&chip->dev); 305 - */ 306 - return chip->driver_data; 304 + return dev_get_drvdata(&chip->dev); 307 305 } 308 306 309 307 static inline void pwmchip_set_drvdata(struct pwm_chip *chip, void *data) 310 308 { 311 - /* 312 - * After pwm_chip got a dedicated struct device, this can be replaced by 313 - * dev_set_drvdata(&chip->dev, data); 314 - */ 315 - chip->driver_data = data; 309 + dev_set_drvdata(&chip->dev, data); 316 310 } 317 311 318 312 #if IS_ENABLED(CONFIG_PWM)