]> git.baikalelectronics.ru Git - kernel.git/commit
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)
commitb4e9079227f39f22a11e63e551c5f3357683bdcc
treeee4adec16869b918a08c69a0fa09aaab2c5d2982
parent0ad05a30bb450ce4dbeb30dcb298eb4828a05131
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