]> www.infradead.org Git - users/jedix/linux-maple.git/commit
tools/lib/thermal: Fix sampling handler context ptr
authorEmil Dahl Juhl <emdj@bang-olufsen.dk>
Tue, 15 Oct 2024 17:18:26 +0000 (19:18 +0200)
committerDaniel Lezcano <daniel.lezcano@linaro.org>
Mon, 4 Nov 2024 14:38:29 +0000 (15:38 +0100)
commitfcd54cf480c87b96313a97dbf898c644b7bb3a2e
treecf059a54788afb533c4bb07eb10516fda9b6ece2
parentf16beaaee248eaa37ad40b5905924fcf70ae02e3
tools/lib/thermal: Fix sampling handler context ptr

The sampling handler, provided by the user alongside a void* context,
was invoked with an internal structure instead of the user context.

Correct the invocation of the sampling handler to pass the user context
pointer instead.

Note that the approach taken is similar to that in events.c, and will
reduce the chances of this mistake happening if additional sampling
callbacks are added.

Fixes: 47c4b0de080a ("tools/lib/thermal: Add a thermal library")
Signed-off-by: Emil Dahl Juhl <emdj@bang-olufsen.dk>
Link: https://lore.kernel.org/r/20241015171826.170154-1-emdj@bang-olufsen.dk
Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
tools/lib/thermal/sampling.c