File tree Expand file tree Collapse file tree 2 files changed +24
-3
lines changed
Expand file tree Collapse file tree 2 files changed +24
-3
lines changed Original file line number Diff line number Diff line change @@ -646,7 +646,7 @@ config PWM_STM32_LP
646646 will be called pwm-stm32-lp.
647647
648648config PWM_STMPE
649- bool "STMPE expander PWM export"
649+ tristate "STMPE expander PWM export"
650650 depends on MFD_STMPE
651651 help
652652 This enables support for the PWMs found in the STMPE I/O
Original file line number Diff line number Diff line change @@ -326,12 +326,33 @@ static int __init stmpe_pwm_probe(struct platform_device *pdev)
326326 return ret ;
327327 }
328328
329+ platform_set_drvdata (pdev , chip );
330+
329331 return 0 ;
330332}
331333
332- static struct platform_driver stmpe_pwm_driver = {
334+ static void __exit stmpe_pwm_remove (struct platform_device * pdev )
335+ {
336+ struct stmpe * stmpe = dev_get_drvdata (pdev -> dev .parent );
337+ struct pwm_chip * chip = platform_get_drvdata (pdev );
338+
339+ pwmchip_remove (chip );
340+ stmpe_disable (stmpe , STMPE_BLOCK_PWM );
341+ }
342+
343+ /*
344+ * stmpe_pwm_remove() lives in .exit.text. For drivers registered via
345+ * module_platform_driver_probe() this is ok because they cannot get unbound at
346+ * runtime. So mark the driver struct with __refdata to prevent modpost
347+ * triggering a section mismatch warning.
348+ */
349+ static struct platform_driver stmpe_pwm_driver __refdata = {
333350 .driver = {
334351 .name = "stmpe-pwm" ,
335352 },
353+ .remove = __exit_p (stmpe_pwm_remove ),
336354};
337- builtin_platform_driver_probe (stmpe_pwm_driver , stmpe_pwm_probe );
355+ module_platform_driver_probe (stmpe_pwm_driver , stmpe_pwm_probe );
356+
357+ MODULE_DESCRIPTION ("STMPE expander PWM" );
358+ MODULE_LICENSE ("GPL" );
You can’t perform that action at this time.
0 commit comments