hc
2024-02-20 102a0743326a03cd1a1202ceda21e175b7d3575c
kernel/drivers/iio/temperature/hid-sensor-temperature.c
....@@ -1,25 +1,12 @@
1
+// SPDX-License-Identifier: GPL-2.0-only
12 /*
23 * HID Sensors Driver
34 * Copyright (c) 2017, Intel Corporation.
4
- *
5
- * This program is free software; you can redistribute it and/or modify it
6
- * under the terms and conditions of the GNU General Public License,
7
- * version 2, as published by the Free Software Foundation.
8
- *
9
- * This program is distributed in the hope it will be useful, but WITHOUT
10
- * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
- * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12
- * more details.
13
- *
14
- * You should have received a copy of the GNU General Public License along with
15
- * this program.
165 */
176 #include <linux/device.h>
187 #include <linux/hid-sensor-hub.h>
198 #include <linux/iio/buffer.h>
209 #include <linux/iio/iio.h>
21
-#include <linux/iio/triggered_buffer.h>
22
-#include <linux/iio/trigger_consumer.h>
2310 #include <linux/module.h>
2411 #include <linux/platform_device.h>
2512
....@@ -238,17 +225,12 @@
238225
239226 indio_dev->channels = temp_chans;
240227 indio_dev->num_channels = ARRAY_SIZE(temperature_channels);
241
- indio_dev->dev.parent = &pdev->dev;
242228 indio_dev->info = &temperature_info;
243229 indio_dev->name = name;
244230 indio_dev->modes = INDIO_DIRECT_MODE;
245231
246
- ret = devm_iio_triggered_buffer_setup(&pdev->dev, indio_dev,
247
- &iio_pollfunc_store_time, NULL, NULL);
248
- if (ret)
249
- return ret;
250
-
251232 atomic_set(&temp_st->common_attributes.data_ready, 0);
233
+
252234 ret = hid_sensor_setup_trigger(indio_dev, name,
253235 &temp_st->common_attributes);
254236 if (ret)
....@@ -271,7 +253,7 @@
271253 error_remove_callback:
272254 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TEMPERATURE);
273255 error_remove_trigger:
274
- hid_sensor_remove_trigger(&temp_st->common_attributes);
256
+ hid_sensor_remove_trigger(indio_dev, &temp_st->common_attributes);
275257 return ret;
276258 }
277259
....@@ -283,7 +265,7 @@
283265 struct temperature_state *temp_st = iio_priv(indio_dev);
284266
285267 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_TEMPERATURE);
286
- hid_sensor_remove_trigger(&temp_st->common_attributes);
268
+ hid_sensor_remove_trigger(indio_dev, &temp_st->common_attributes);
287269
288270 return 0;
289271 }