diff options
| author | Vincent Cloutier <vincent@cloutier.co> | 2026-07-26 21:12:59 -0400 |
|---|---|---|
| committer | Sebastian Reichel <sebastian.reichel@collabora.com> | 2026-07-27 20:32:38 +0200 |
| commit | c1eb5905fdce35a66173658a93819641e5220c18 (patch) | |
| tree | e333264656504bf519d602dc06c543143f5d9625 /tools/perf/scripts/python/task-analyzer.py | |
| parent | ab1112df8f4ffa88cb024dd370c432ced80f77d8 (diff) | |
power: supply: Add registration init callback
Some battery drivers need to consume monitored-battery data before their
power_supply is visible. That lets them prepare hardware configuration from
parsed battery information without racing userspace exposure.
power_supply_get_battery_info() already runs in
__power_supply_register() for battery devices before device_add(). Add an
optional descriptor init callback after driver data and battery info are
available. The callback runs in sleepable process context while the power
supply is still unpublished.
Keep the callback synchronous: it must not publish changes or start
asynchronous activity that can access the power supply before registration
completes.
Require callbacks to return zero or a negative errno. Defensively reject
positive returns so registration cannot return an invalid error pointer.
Assisted-by: OpenCode:gpt-5.6-sol
Signed-off-by: Vincent Cloutier <vincent@cloutier.co>
Link: https://patch.msgid.link/20260727011319.621794-2-vincent.cloutier@icloud.com
Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.com>
Diffstat (limited to 'tools/perf/scripts/python/task-analyzer.py')
0 files changed, 0 insertions, 0 deletions
