aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/magnetometer/hid-sensor-magn-3d.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/iio/magnetometer/hid-sensor-magn-3d.c')
-rw-r--r--drivers/iio/magnetometer/hid-sensor-magn-3d.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/iio/magnetometer/hid-sensor-magn-3d.c b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
index 2634920562fb..b26e1028a0a0 100644
--- a/drivers/iio/magnetometer/hid-sensor-magn-3d.c
+++ b/drivers/iio/magnetometer/hid-sensor-magn-3d.c
@@ -351,7 +351,7 @@ static int hid_magn_3d_probe(struct platform_device *pdev)
351error_iio_unreg: 351error_iio_unreg:
352 iio_device_unregister(indio_dev); 352 iio_device_unregister(indio_dev);
353error_remove_trigger: 353error_remove_trigger:
354 hid_sensor_remove_trigger(indio_dev); 354 hid_sensor_remove_trigger(&magn_state->common_attributes);
355error_unreg_buffer_funcs: 355error_unreg_buffer_funcs:
356 iio_triggered_buffer_cleanup(indio_dev); 356 iio_triggered_buffer_cleanup(indio_dev);
357error_free_dev_mem: 357error_free_dev_mem:
@@ -364,10 +364,11 @@ static int hid_magn_3d_remove(struct platform_device *pdev)
364{ 364{
365 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data; 365 struct hid_sensor_hub_device *hsdev = pdev->dev.platform_data;
366 struct iio_dev *indio_dev = platform_get_drvdata(pdev); 366 struct iio_dev *indio_dev = platform_get_drvdata(pdev);
367 struct magn_3d_state *magn_state = iio_priv(indio_dev);
367 368
368 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D); 369 sensor_hub_remove_callback(hsdev, HID_USAGE_SENSOR_COMPASS_3D);
369 iio_device_unregister(indio_dev); 370 iio_device_unregister(indio_dev);
370 hid_sensor_remove_trigger(indio_dev); 371 hid_sensor_remove_trigger(&magn_state->common_attributes);
371 iio_triggered_buffer_cleanup(indio_dev); 372 iio_triggered_buffer_cleanup(indio_dev);
372 kfree(indio_dev->channels); 373 kfree(indio_dev->channels);
373 374