diff options
author | Moti Haimovski <mhaimovski@habana.ai> | 2020-01-23 18:03:04 +0200 |
---|---|---|
committer | Oded Gabbay <oded.gabbay@gmail.com> | 2020-03-24 10:54:16 +0200 |
commit | d57b83c3dfe55747f1a43f9d9fbadeff7b5a3cd5 (patch) | |
tree | c1447e4535ff60ffc26edf558ecdba112d0b23b2 /drivers/misc/habanalabs/habanalabs.h | |
parent | 5557b138dc11a1b93fec69c7d8760d38fc56e580 (diff) | |
download | lwn-d57b83c3dfe55747f1a43f9d9fbadeff7b5a3cd5.tar.gz lwn-d57b83c3dfe55747f1a43f9d9fbadeff7b5a3cd5.zip |
habanalabs: modify the return values of hl_read/write routines
The hl read and write routines implement the hwmon_ops read and write
interface routines respectively.
These routines are expected to return a completion status when called,
which was not the case until this commit.
This commit modifies these routines to return 0 upon success and a
negative error value upon failure.
Signed-off-by: Moti Haimovski <mhaimovski@habana.ai>
Reviewed-by: Oded Gabbay <oded.gabbay@gmail.com>
Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com>
Diffstat (limited to 'drivers/misc/habanalabs/habanalabs.h')
-rw-r--r-- | drivers/misc/habanalabs/habanalabs.h | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/drivers/misc/habanalabs/habanalabs.h b/drivers/misc/habanalabs/habanalabs.h index 4de12d3ff836..9472da3ef847 100644 --- a/drivers/misc/habanalabs/habanalabs.h +++ b/drivers/misc/habanalabs/habanalabs.h @@ -1609,13 +1609,18 @@ int hl_pci_set_dma_mask(struct hl_device *hdev, u8 dma_mask); long hl_get_frequency(struct hl_device *hdev, u32 pll_index, bool curr); void hl_set_frequency(struct hl_device *hdev, u32 pll_index, u64 freq); -long hl_get_temperature(struct hl_device *hdev, int sensor_index, u32 attr); +int hl_get_temperature(struct hl_device *hdev, + int sensor_index, u32 attr, long *value); int hl_set_temperature(struct hl_device *hdev, - int sensor_index, u32 attr, long value); -long hl_get_voltage(struct hl_device *hdev, int sensor_index, u32 attr); -long hl_get_current(struct hl_device *hdev, int sensor_index, u32 attr); -long hl_get_fan_speed(struct hl_device *hdev, int sensor_index, u32 attr); -long hl_get_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr); + int sensor_index, u32 attr, long value); +int hl_get_voltage(struct hl_device *hdev, + int sensor_index, u32 attr, long *value); +int hl_get_current(struct hl_device *hdev, + int sensor_index, u32 attr, long *value); +int hl_get_fan_speed(struct hl_device *hdev, + int sensor_index, u32 attr, long *value); +int hl_get_pwm_info(struct hl_device *hdev, + int sensor_index, u32 attr, long *value); void hl_set_pwm_info(struct hl_device *hdev, int sensor_index, u32 attr, long value); u64 hl_get_max_power(struct hl_device *hdev); |