2
0
mirror of https://github.com/edk2-porting/linux-next.git synced 2024-12-17 01:34:00 +08:00

ahci: imx: fix building without hwmon or thermal

When CONFIG_HWMON is disabled, we now get a link failure:

ERROR: "devm_hwmon_device_register_with_groups" [drivers/ata/ahci_imx.ko] undefined!
drivers/ata/ahci_imx.o: In function `imx_ahci_probe':
ahci_imx.c:(.text.imx_ahci_probe+0x304): undefined reference to `devm_thermal_zone_of_sensor_register'

This makes the code calling into the hwmon subsystem compile-time
conditional, and adds a Kconfig dependency to avoid the corner
case of having HWMON=m and AHCI_IMX=y, by forcing AHCI_IMX=m in this
case. The thermal subsystem already has a check in its header, but
that also doesn't cover the THERMAL=m case, so we need a somewhat
complex Kconfig expression to handle all cases.

Fixes: 54643a83b4 ("ahci: imx: Add imx53 SATA temperature sensor support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
This commit is contained in:
Arnd Bergmann 2017-01-11 14:36:16 +01:00 committed by Tejun Heo
parent 7e11aabd48
commit d7969f5976
2 changed files with 3 additions and 1 deletions

View File

@ -129,6 +129,7 @@ config AHCI_ST
config AHCI_IMX config AHCI_IMX
tristate "Freescale i.MX AHCI SATA support" tristate "Freescale i.MX AHCI SATA support"
depends on MFD_SYSCON && (ARCH_MXC || COMPILE_TEST) depends on MFD_SYSCON && (ARCH_MXC || COMPILE_TEST)
depends on (HWMON && (THERMAL || !THERMAL_OF)) || !HWMON
help help
This option enables support for the Freescale i.MX SoC's This option enables support for the Freescale i.MX SoC's
onboard AHCI SATA. onboard AHCI SATA.

View File

@ -774,7 +774,8 @@ static int imx_ahci_probe(struct platform_device *pdev)
if (ret) if (ret)
return ret; return ret;
if (imxpriv->type == AHCI_IMX53) { if (imxpriv->type == AHCI_IMX53 &&
IS_ENABLED(CONFIG_HWMON)) {
/* Add the temperature monitor */ /* Add the temperature monitor */
struct device *hwmon_dev; struct device *hwmon_dev;