mfd / platform: cros_ec_vbc: Instantiate only if the EC has a VBC NVRAM
authorEnric Balletbo i Serra <enric.balletbo@collabora.com>
Wed, 12 Dec 2018 17:34:01 +0000 (18:34 +0100)
committerLee Jones <lee.jones@linaro.org>
Fri, 1 Feb 2019 08:09:27 +0000 (08:09 +0000)
commit0545625baa5981bb0a583e6a6045155936d3ea95
treeee4adec16869b918a08c69a0fa09aaab2c5d2982
parent6fd7f2bbd4422e7635bc771cd1ec440378158cb1
mfd / platform: cros_ec_vbc: Instantiate only if the EC has a VBC NVRAM

The cros-ec-vbc driver is DT-only and there is a DT property that
indicates if the EC has the VCB NVRAM, in such case instantiate the
driver but don't instantiate on the other cases.

To do this move the check code to its parent instead of play with the
attribute group visibility. This changes a bit the actual behaviour.
Before the patch if an EC doesn't have a VBC NVRAM an empty vbc folder
is created in /sys/class/chromeos/<ec-device-name>, after the patch the
empty folder is not created, so, the folder is only created if the vbc
is set.

Signed-off-by: Enric Balletbo i Serra <enric.balletbo@collabora.com>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Lee Jones <lee.jones@linaro.org>
drivers/mfd/cros_ec_dev.c
drivers/platform/chrome/cros_ec_vbc.c