aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2019-12-03 14:37:12 -0800
committerLinus Torvalds <torvalds@linux-foundation.org>2019-12-03 14:37:12 -0800
commit63de37476ebd1e9bab6a9e17186dc5aa1da9ea99 (patch)
tree5c35ba6ec9e4043a7138e68592df919a06024778 /drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
parentMerge tag 'spdx-5.5-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/spdx (diff)
parentplatform/chrome: wilco_ec: fix use after free issue (diff)
downloadlinux-dev-63de37476ebd1e9bab6a9e17186dc5aa1da9ea99.tar.xz
linux-dev-63de37476ebd1e9bab6a9e17186dc5aa1da9ea99.zip
Merge tag 'tag-chrome-platform-for-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux
Pull chrome platform changes from Benson Leung: "CrOS EC / MFD / IIO: - Contains tag-ib-chrome-mfd-iio-input-5.5, which is the first part of a series from Gwendal to refactor sensor code between MFD, CrOS EC, iio and input in order to add a new sensorhub driver and FIFO processing Wilco EC: - Add support for Dell's USB PowerShare policy control, keyboard backlight LED driver, and a new test_event file. - Fixes use after free in wilco_ec's telemetry driver. Misc: - bugfix in cros_usbpd_logger (missing destroy workqueue)" * tag 'tag-chrome-platform-for-v5.5' of git://git.kernel.org/pub/scm/linux/kernel/git/chrome-platform/linux: platform/chrome: wilco_ec: fix use after free issue platform/chrome: cros_ec: Add Kconfig default for cros-ec-sensorhub Revert "Input: cros_ec_keyb: mask out extra flags in event_type" Revert "Input: cros_ec_keyb - add back missing mask for event_type" platform/chrome: cros_ec: handle MKBP more events flag platform/chrome: cros_ec: Do not attempt to register a non-positive IRQ number platform/chrome: cros-ec: Record event timestamp in the hard irq mfd / platform / iio: cros_ec: Register sensor through sensorhub iio / platform: cros_ec: Add cros-ec-sensorhub driver mfd / platform: cros_ec: Add sensor_count and make check_features public platform/chrome: cros_ec: Put docs with the code platform/chrome: cros_usbpd_logger: add missed destroy_workqueue in remove platform/chrome: cros_ec: Fix Kconfig indentation platform/chrome: wilco_ec: Add keyboard backlight LED support platform/chrome: wilco_ec: Add charging config driver platform/chrome: wilco_ec: Add Dell's USB PowerShare Policy control platform/chrome: wilco_ec: Add debugfs test_event file
Diffstat (limited to 'drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c')
-rw-r--r--drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
index d2609e6feda4..81a7f692de2f 100644
--- a/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
+++ b/drivers/iio/common/cros_ec_sensors/cros_ec_sensors_core.c
@@ -18,6 +18,7 @@
#include <linux/slab.h>
#include <linux/platform_data/cros_ec_commands.h>
#include <linux/platform_data/cros_ec_proto.h>
+#include <linux/platform_data/cros_ec_sensorhub.h>
#include <linux/platform_device.h>
static char *cros_ec_loc[] = {
@@ -88,7 +89,8 @@ int cros_ec_sensors_core_init(struct platform_device *pdev,
{
struct device *dev = &pdev->dev;
struct cros_ec_sensors_core_state *state = iio_priv(indio_dev);
- struct cros_ec_dev *ec = dev_get_drvdata(pdev->dev.parent);
+ struct cros_ec_sensorhub *sensor_hub = dev_get_drvdata(dev->parent);
+ struct cros_ec_dev *ec = sensor_hub->ec;
struct cros_ec_sensor_platform *sensor_platform = dev_get_platdata(dev);
u32 ver_mask;
int ret, i;