summaryrefslogtreecommitdiff
path: root/drivers/iio/temperature/hid-sensor-temperature.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/temperature/hid-sensor-temperature.c')
-rw-r--r--drivers/iio/temperature/hid-sensor-temperature.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/iio/temperature/hid-sensor-temperature.c b/drivers/iio/temperature/hid-sensor-temperature.c
index 5e3262e461f4..ae67daff6df5 100644
--- a/drivers/iio/temperature/hid-sensor-temperature.c
+++ b/drivers/iio/temperature/hid-sensor-temperature.c
@@ -15,6 +15,7 @@
struct temperature_state {
struct hid_sensor_common common_attributes;
struct hid_sensor_hub_attribute_info temperature_attr;
+ struct hid_sensor_hub_callbacks callbacks;
struct {
s32 temperature_data;
aligned_s64 timestamp;
@@ -181,11 +182,6 @@ static int temperature_parse_report(struct platform_device *pdev,
return ret;
}
-static struct hid_sensor_hub_callbacks temperature_callbacks = {
- .send_event = &temperature_proc_event,
- .capture_sample = &temperature_capture_sample,
-};
-
/* Function to initialize the processing for usage id */
static int hid_temperature_probe(struct platform_device *pdev)
{
@@ -237,9 +233,13 @@ static int hid_temperature_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, indio_dev);
- temperature_callbacks.pdev = pdev;
+ temp_st->callbacks = (struct hid_sensor_hub_callbacks) {
+ .send_event = temperature_proc_event,
+ .capture_sample = temperature_capture_sample,
+ .pdev = pdev,
+ };
ret = sensor_hub_register_callback(hsdev, HID_USAGE_SENSOR_TEMPERATURE,
- &temperature_callbacks);
+ &temp_st->callbacks);
if (ret)
goto error_remove_trigger;