Re: [PATCH v5 1/2] USB host: Move AMD PLL quirk to pci-quirks.c

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 24 Jan 2011, Andiry Xu wrote:

> diff --git a/drivers/usb/host/ehci-hcd.c b/drivers/usb/host/ehci-hcd.c
> index 6fee3cd..4a4b475 100644
> --- a/drivers/usb/host/ehci-hcd.c
> +++ b/drivers/usb/host/ehci-hcd.c
> @@ -114,16 +114,44 @@ MODULE_PARM_DESC(hird, "host initiated resume duration, +1 for each 75us\n");
>  
>  #define	INTR_MASK (STS_IAA | STS_FATAL | STS_PCD | STS_ERR | STS_INT)
>  
> -/* for ASPM quirk of ISOC on AMD SB800 */
> -static struct pci_dev *amd_nb_dev;
> -
>  /*-------------------------------------------------------------------------*/
>  
>  #include "ehci.h"
>  #include "ehci-dbg.c"
> +#ifdef CONFIG_PCI
> +#include "pci-quirks.h"
> +#endif
>  
>  /*-------------------------------------------------------------------------*/
>  
> +#ifdef CONFIG_PCI
> +static void ehci_amd_quirk_pll_disable(void)
> +{
> +	usb_amd_quirk_pll(1);
> +}
> +static void ehci_amd_quirk_pll_enable(void)
> +{
> +	usb_amd_quirk_pll(0);
> +}
> +static void ehci_amd_dev_put(void)
> +{
> +	usb_amd_dev_put();
> +}
> +#else
> +static inline void ehci_amd_quirk_pll_disable(void)
> +{
> +	return;
> +}
> +static inline void ehci_amd_quirk_pll_enable(void)
> +{
> +	return;
> +}
> +static inline void ehci_amd_dev_put(void)
> +{
> +	return;
> +}
> +#endif
> +

Better than before, but still not the best.  The right to do this is to
have these declarations in one place, in pci-quirks.h instead of each
of the host controller drivers (name them usb_amd_quirk_pll_disable()
and so on instead of ehci_amd_...).  Put a "#ifdef CONFIG_PCI" near the
start of pci-quirks.h so each driver can #include the header
unconditionally, thereby getting the real declarations or the inline 
stubs as appropriate.

Alan Stern

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux