diff options
author | Arnd Bergmann <arnd@arndb.de> | 2018-10-11 10:57:57 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-10-11 10:21:15 -0700 |
commit | e70a57fa59bb7fefe063780a49e063d0d0f61863 (patch) | |
tree | 351e6219be28b921db55905f72490eb271a0d31b /drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | |
parent | 1f41dc5e8756f444a66cc47a7d3a58ae78b5c0cd (diff) | |
download | blackbird-obmc-linux-e70a57fa59bb7fefe063780a49e063d0d0f61863.tar.gz blackbird-obmc-linux-e70a57fa59bb7fefe063780a49e063d0d0f61863.zip |
cxgb4: fix thermal configuration dependencies
With CONFIG_THERMAL=m, we get a build error:
drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c: In function 'cxgb4_thermal_get_trip_type':
drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.c:48:11: error: 'struct adapter' has no member named 'ch_thermal'
Once that is fixed by using IS_ENABLED() checks, we get a link error
against the thermal subsystem when cxgb4 is built-in:
drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.o: In function `cxgb4_thermal_init':
cxgb4_thermal.c:(.text+0x180): undefined reference to `thermal_zone_device_register'
drivers/net/ethernet/chelsio/cxgb4/cxgb4_thermal.o: In function `cxgb4_thermal_remove':
cxgb4_thermal.c:(.text+0x1e0): undefined reference to `thermal_zone_device_unregister'
Finally, since CONFIG_THERMAL can be =m, the Makefile fails to pick up the
extra file into built-in.a, and we get another link failure against the
cxgb4_thermal_init/cxgb4_thermal_remove files, so the Makefile has to
be adapted as well to work for both CONFIG_THERMAL=y and =m.
Fixes: b18719157762 ("cxgb4: Add thermal zone support")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/chelsio/cxgb4/cxgb4.h')
-rw-r--r-- | drivers/net/ethernet/chelsio/cxgb4/cxgb4.h | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h index 95909f0686b1..b16f4b3ef4c5 100644 --- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h +++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4.h @@ -891,7 +891,7 @@ struct mps_encap_entry { atomic_t refcnt; }; -#ifdef CONFIG_THERMAL +#if IS_ENABLED(CONFIG_THERMAL) struct ch_thermal { struct thermal_zone_device *tzdev; int trip_temp; @@ -1017,7 +1017,7 @@ struct adapter { /* Dump buffer for collecting logs in kdump kernel */ struct vmcoredd_data vmcoredd; -#ifdef CONFIG_THERMAL +#if IS_ENABLED(CONFIG_THERMAL) struct ch_thermal ch_thermal; #endif }; @@ -1875,9 +1875,7 @@ int t4_set_vlan_acl(struct adapter *adap, unsigned int mbox, unsigned int vf, u16 vlan); int cxgb4_dcb_enabled(const struct net_device *dev); -#ifdef CONFIG_THERMAL int cxgb4_thermal_init(struct adapter *adap); int cxgb4_thermal_remove(struct adapter *adap); -#endif /* CONFIG_THERMAL */ #endif /* __CXGB4_H__ */ |