Re: [PATCH] mfd: cros_ec: move cros_ec_dev driver to MFD subdir.

From: Lee Jones
Date: Thu Sep 28 2017 - 15:22:56 EST


On Mon, 25 Sep 2017, Enric Balletbo i Serra wrote:

> The cros_ec_dev serves multiple purposes, one is register dinamically the
> MFD subdevices by checking the features available in a specific ChromeOS
> Embedded Controller, hence there are different calls to mfd_add_devices.
> The first time we upstreamed this driver was placed in
> drivers/platform/chrome, but call mfd_add_devices outside MFD is wrong.
> As cros_ec_dev driver is strongly related to the MFD cros-ec-core would
> make sense move the driver to the mfd subdir.
>
> This patch also fixes a small module loading issue, the name of the driver
> in the C code was not matching their Makefile names, this prevented the
> driver from loaded as module.
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@xxxxxxxxxxxxx>
> ---
> drivers/mfd/Kconfig | 9 +++++++++
> drivers/mfd/Makefile | 4 ++++
> drivers/{platform/chrome => mfd}/cros_ec_debugfs.c | 0
> drivers/{platform/chrome => mfd}/cros_ec_debugfs.h | 0
> drivers/{platform/chrome => mfd}/cros_ec_dev.c | 5 ++++-
> drivers/{platform/chrome => mfd}/cros_ec_dev.h | 0
> drivers/{platform/chrome => mfd}/cros_ec_lightbar.c | 0
> drivers/{platform/chrome => mfd}/cros_ec_sysfs.c | 0
> drivers/{platform/chrome => mfd}/cros_ec_vbc.c | 0
> drivers/platform/chrome/Kconfig | 9 ---------
> drivers/platform/chrome/Makefile | 4 ----
> 11 files changed, 17 insertions(+), 14 deletions(-)
> rename drivers/{platform/chrome => mfd}/cros_ec_debugfs.c (100%)
> rename drivers/{platform/chrome => mfd}/cros_ec_debugfs.h (100%)
> rename drivers/{platform/chrome => mfd}/cros_ec_dev.c (99%)
> rename drivers/{platform/chrome => mfd}/cros_ec_dev.h (100%)
> rename drivers/{platform/chrome => mfd}/cros_ec_lightbar.c (100%)
> rename drivers/{platform/chrome => mfd}/cros_ec_sysfs.c (100%)
> rename drivers/{platform/chrome => mfd}/cros_ec_vbc.c (100%)

This is not what I had in mind.

Only the MFD portion (the part which registers other devices) should
live in drivers/mfd. Everything else should either live in their
respective subsystem(s) or in drivers/platform.

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org â Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog