From 45ac6a30f922f4eef54c0120c2a537794b20cf5c Mon Sep 17 00:00:00 2001 From: Shaun Ruffell Date: Tue, 24 Sep 2019 19:51:22 -0500 Subject: [PATCH] voicebus, wcaxx, wct4xxp: Remove include of pci-aspm.h Linux 5.4, in commit (7ce2e76a0420801fb4b53b9e685094 "PCI: Move ASPM declarations to linux/pci.h") [1], removed pci-aspm.h. This commit removes the global include of pci-aspm.h in include/dahdi/kernel.h (because it only pertains to certain drivers), and moves the conditional include into only the drivers that need it. [1] https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=7ce2e76a0420801fb4b53b9e685094 Signed-off-by: Shaun Ruffell --- drivers/dahdi/voicebus/voicebus.h | 6 +++++- drivers/dahdi/wcaxx-base.c | 6 ++++++ drivers/dahdi/wct4xxp/base.c | 6 ++++++ include/dahdi/kernel.h | 4 ---- 4 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/dahdi/voicebus/voicebus.h b/drivers/dahdi/voicebus/voicebus.h index faece9a..2eb1146 100644 --- a/drivers/dahdi/voicebus/voicebus.h +++ b/drivers/dahdi/voicebus/voicebus.h @@ -64,7 +64,11 @@ * platform does not support it. * */ -#undef CONFIG_VOICEBUS_DISABLE_ASPM +#ifdef CONFIG_VOICEBUS_DISABLE_ASPM +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) +#include +#endif +#endif /* Define this to use a FIFO for the software echocan reference. * (experimental) */ diff --git a/drivers/dahdi/wcaxx-base.c b/drivers/dahdi/wcaxx-base.c index b934960..8903e5d 100644 --- a/drivers/dahdi/wcaxx-base.c +++ b/drivers/dahdi/wcaxx-base.c @@ -67,6 +67,12 @@ #include "wcxb_spi.h" #include "wcxb_flash.h" +#ifdef CONFIG_VOICEBUS_DISABLE_ASPM +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) +#include +#endif +#endif + /*! * \brief Default ringer debounce (in ms) */ diff --git a/drivers/dahdi/wct4xxp/base.c b/drivers/dahdi/wct4xxp/base.c index 7089ec1..ad35569 100644 --- a/drivers/dahdi/wct4xxp/base.c +++ b/drivers/dahdi/wct4xxp/base.c @@ -87,6 +87,12 @@ */ /* #define CONFIG_WCT4XXP_DISABLE_ASPM */ +#ifdef CONFIG_WCT4XXP_DISABLE_ASPM +#if LINUX_VERSION_CODE < KERNEL_VERSION(5, 4, 0) +#include +#endif +#endif + #if defined(CONFIG_FORCE_EXTENDED_RESET) && defined(CONFIG_NOEXTENDED_RESET) #error "You cannot define both CONFIG_FORCE_EXTENDED_RESET and " \ "CONFIG_NOEXTENDED_RESET." diff --git a/include/dahdi/kernel.h b/include/dahdi/kernel.h index 22b9b66..cf629eb 100644 --- a/include/dahdi/kernel.h +++ b/include/dahdi/kernel.h @@ -58,10 +58,6 @@ #include -#ifdef CONFIG_PCI -#include -#endif - #if LINUX_VERSION_CODE >= KERNEL_VERSION(2, 6, 29) #define HAVE_NET_DEVICE_OPS #endif