aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/cros_ec_dev.c
diff options
context:
space:
mode:
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>2019-09-02 11:53:09 +0200
committerLee Jones <lee.jones@linaro.org>2019-09-02 11:34:24 +0100
commit28e6fcc871bcff640c8960448034ea3a7c7fdfa3 (patch)
treeb6e2fb991585cf186dea103886011a1268ee62bb /drivers/mfd/cros_ec_dev.c
parentmfd: cros_ec: Add convenience struct to define autodetectable CrOS EC subdevices (diff)
downloadlinux-dev-28e6fcc871bcff640c8960448034ea3a7c7fdfa3.tar.xz
linux-dev-28e6fcc871bcff640c8960448034ea3a7c7fdfa3.zip
mfd: cros_ec: Use mfd_add_hotplug_devices() helper
Use mfd_add_hotplug_devices() helper to register the subdevices. The helper allows us to reduce the boiler plate and also registers the subdevices in the same way as used in other functions used in this files. Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com> Reviewed-by: Gwendal Grignou <gwendal@chromium.org> Tested-by: Gwendal Grignou <gwendal@chromium.org> Signed-off-by: Lee Jones <lee.jones@linaro.org>
Diffstat (limited to 'drivers/mfd/cros_ec_dev.c')
-rw-r--r--drivers/mfd/cros_ec_dev.c18
1 files changed, 6 insertions, 12 deletions
diff --git a/drivers/mfd/cros_ec_dev.c b/drivers/mfd/cros_ec_dev.c
index 90eb02c56b77..6e6dfd6c1871 100644
--- a/drivers/mfd/cros_ec_dev.c
+++ b/drivers/mfd/cros_ec_dev.c
@@ -329,10 +329,8 @@ static void cros_ec_accel_legacy_register(struct cros_ec_dev *ec)
* Register 2 accelerometers, we will fail in the IIO driver if there
* are no sensors.
*/
- ret = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
- cros_ec_accel_legacy_cells,
- ARRAY_SIZE(cros_ec_accel_legacy_cells),
- NULL, 0, NULL);
+ ret = mfd_add_hotplug_devices(ec->dev, cros_ec_accel_legacy_cells,
+ ARRAY_SIZE(cros_ec_accel_legacy_cells));
if (ret)
dev_err(ec_dev->dev, "failed to add EC sensors\n");
}
@@ -419,10 +417,8 @@ static int ec_device_probe(struct platform_device *pdev)
* The following subdevices cannot be detected by sending the
* EC_FEATURE_GET_CMD to the Embedded Controller device.
*/
- retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
- cros_ec_platform_cells,
- ARRAY_SIZE(cros_ec_platform_cells),
- NULL, 0, NULL);
+ retval = mfd_add_hotplug_devices(ec->dev, cros_ec_platform_cells,
+ ARRAY_SIZE(cros_ec_platform_cells));
if (retval)
dev_warn(ec->dev,
"failed to add cros-ec platform devices: %d\n",
@@ -431,10 +427,8 @@ static int ec_device_probe(struct platform_device *pdev)
/* Check whether this EC instance has a VBC NVRAM */
node = ec->ec_dev->dev->of_node;
if (of_property_read_bool(node, "google,has-vbc-nvram")) {
- retval = mfd_add_devices(ec->dev, PLATFORM_DEVID_AUTO,
- cros_ec_vbc_cells,
- ARRAY_SIZE(cros_ec_vbc_cells),
- NULL, 0, NULL);
+ retval = mfd_add_hotplug_devices(ec->dev, cros_ec_vbc_cells,
+ ARRAY_SIZE(cros_ec_vbc_cells));
if (retval)
dev_warn(ec->dev, "failed to add VBC devices: %d\n",
retval);