summaryrefslogtreecommitdiffstats
path: root/drivers/ata/ahci_imx.c
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2017-01-11 14:36:16 +0100
committerTejun Heo <tj@kernel.org>2017-01-16 00:51:12 +0100
commitd7969f5976a35b48ba4eb60aaad73535f1792019 (patch)
tree371a1a4c521ef61d82ba106dcaea3f4f507d6330 /drivers/ata/ahci_imx.c
parentata: add Atari Falcon PATA controller driver (diff)
downloadlinux-d7969f5976a35b48ba4eb60aaad73535f1792019.tar.xz
linux-d7969f5976a35b48ba4eb60aaad73535f1792019.zip
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: 54643a83b41a ("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>
Diffstat (limited to 'drivers/ata/ahci_imx.c')
-rw-r--r--drivers/ata/ahci_imx.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/ata/ahci_imx.c b/drivers/ata/ahci_imx.c
index 420f065978dc..787567e840bd 100644
--- a/drivers/ata/ahci_imx.c
+++ b/drivers/ata/ahci_imx.c
@@ -774,7 +774,8 @@ static int imx_ahci_probe(struct platform_device *pdev)
if (ret)
return ret;
- if (imxpriv->type == AHCI_IMX53) {
+ if (imxpriv->type == AHCI_IMX53 &&
+ IS_ENABLED(CONFIG_HWMON)) {
/* Add the temperature monitor */
struct device *hwmon_dev;