Commit 447be50
regulator: pca9450: Use devm_register_sys_off_handler
With module test, there is error dump:
------------[ cut here ]------------
notifier callback pca9450_i2c_restart_handler already registered
WARNING: kernel/notifier.c:23 at notifier_chain_register+0x5c/0x88,
CPU#0: kworker/u16:3/50
Call trace:
notifier_chain_register+0x5c/0x88 (P)
atomic_notifier_chain_register+0x30/0x58
register_restart_handler+0x1c/0x28
pca9450_i2c_probe+0x418/0x538
i2c_device_probe+0x220/0x3d0
really_probe+0x114/0x410
__driver_probe_device+0xa0/0x150
driver_probe_device+0x40/0x114
__device_attach_driver+0xd4/0x12c
So use devm_register_sys_off_handler to let kernel handle the resource
free to avoid kernel dump.
Fixes: 6157e62 ("regulator: pca9450: Add restart handler")
Signed-off-by: Peng Fan <peng.fan@nxp.com>
Link: https://patch.msgid.link/20250815-pca9450-v1-1-7748e362dc97@nxp.com
Signed-off-by: Mark Brown <broonie@kernel.org>1 parent 4b0ad96 commit 447be50
1 file changed
Lines changed: 5 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
40 | 40 | | |
41 | 41 | | |
42 | 42 | | |
43 | | - | |
44 | 43 | | |
45 | 44 | | |
46 | 45 | | |
| |||
1100 | 1099 | | |
1101 | 1100 | | |
1102 | 1101 | | |
1103 | | - | |
1104 | | - | |
| 1102 | + | |
1105 | 1103 | | |
1106 | | - | |
| 1104 | + | |
1107 | 1105 | | |
1108 | 1106 | | |
1109 | 1107 | | |
| |||
1261 | 1259 | | |
1262 | 1260 | | |
1263 | 1261 | | |
1264 | | - | |
1265 | | - | |
1266 | | - | |
1267 | | - | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
1268 | 1265 | | |
1269 | 1266 | | |
1270 | 1267 | | |
| |||
0 commit comments