thermal: ti-soc-thermal: Fix the return value in ti_bandgap_get_sensor_data() kernel-doc
Subsystems (2)
PATCH 1/1 thermal: ti-soc-thermal: Fix the return value in ti_bandgap_get_sensor_data() kernel-doc
ti_bandgap_get_sensor_data() returns an ERR_PTR() if the bandgap instance or sensor ID is invalid. Otherwise it returns the stored sensor data, which can be NULL if no data has been set or the stored value has been cleared.
This mismatch was already present in omap_bandgap_get_sensor_data() when the driver was introduced in staging.
Document the validation errors while retaining NULL as a possible stored value.
--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/thermal/ti-soc-thermal/ti-bandgap.c +2 -1
@@ -576,7 +576,8 @@ int ti_bandgap_set_sensor_data(struct ti_bandgap *bgp, int id, void *data)* @bgp: pointer to bandgap instance * @id: sensor id * -* Return: data stored by set function with sensor id on success or NULL +* Return: the stored sensor data, which may be %NULL, or an ERR_PTR() +* if @bgp or @id is invalid. */ void *ti_bandgap_get_sensor_data (struct ti_bandgap *bgp,int id) {
Signature · 1 line
2.39.5 (Apple Git-154)
Daniel Lezcano
AppliedQuoted 8 lines · Karl Mehltretter
ti_bandgap_get_sensor_data()returns anERR_PTR()if the bandgap instance or sensor ID is invalid. Otherwise it returns the stored sensor data, which can be NULL if no data has been set or the stored value has been cleared.This mismatch was already present in
omap_bandgap_get_sensor_data()when the driver was introduced in staging.
Quoted 7 lines
Document the validation errors while retaining NULL as a possible stored value.
Fixes 8feaf0ce1a04 ("staging: OMAP4+: thermal: introduce bandgap temperature sensor")Assisted-by LLMSigned-off-by Karl Mehltretter <[email protected]>---
Applied, thanks
The following commit has been merged into the thermal/linux-next branch of thermal:
The following commit has been merged into the thermal/linux-next branch of thermal:
Commit-ID: 82bb005cd9cf5a9df4cfe4a52db90346ac5fd17a Gitweb: https://git.kernel.org/pub/scm/linux/kernel/git/thermal/linux.git//82bb005cd9cf5a9df4cfe4a52db90346ac5fd17a Author: Karl Mehltretter <[email protected]> AuthorDate: Sat, 12 Sep 2026 08:22:52 +02:00 Committer: Daniel Lezcano <[email protected]> CommitterDate: Wed, 14 Oct 2026 09:45:41 +02:00
thermal: ti-soc-thermal: Fix the return value in ti_bandgap_get_sensor_data() kernel-doc
ti_bandgap_get_sensor_data() returns an ERR_PTR() if the bandgap instance or sensor ID is invalid. Otherwise it returns the stored sensor data, which can be NULL if no data has been set or the stored value has been cleared.
This mismatch was already present in omap_bandgap_get_sensor_data() when the driver was introduced in staging.
Document the validation errors while retaining NULL as a possible stored value.
--- drivers/thermal/ti-soc-thermal/ti-bandgap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/thermal/ti-soc-thermal/ti-bandgap.c +2 -1
@@ -576,7 +576,8 @@ int ti_bandgap_set_sensor_data(struct ti_bandgap *bgp, int id, void *data)* @bgp: pointer to bandgap instance * @id: sensor id * -* Return: data stored by set function with sensor id on success or NULL +* Return: the stored sensor data, which may be %NULL, or an ERR_PTR() +* if @bgp or @id is invalid. */ void *ti_bandgap_get_sensor_data (struct ti_bandgap *bgp,int id) {