[U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs

Maxime Ripard maxime.ripard at bootlin.com
Fri Jun 8 14:24:38 UTC 2018


On Thu, Jun 07, 2018 at 07:23:39PM -0700, Vasily Khoruzhick wrote:
> We can use compatibles instead.
> 
> Signed-off-by: Vasily Khoruzhick <anarsoul at gmail.com>
> ---
> v3: use ehci_sunxi_cfg instead of id
> 
>  drivers/usb/host/ehci-sunxi.c | 83 ++++++++++++++++++++++++++---------
>  1 file changed, 63 insertions(+), 20 deletions(-)
> 
> diff --git a/drivers/usb/host/ehci-sunxi.c b/drivers/usb/host/ehci-sunxi.c
> index 360efc9116..35fbe03331 100644
> --- a/drivers/usb/host/ehci-sunxi.c
> +++ b/drivers/usb/host/ehci-sunxi.c
> @@ -22,11 +22,17 @@
>  #define AHB_CLK_DIST		1
>  #endif
>  
> +struct ehci_sunxi_cfg {
> +	bool has_reset;
> +	u32 extra_ahb_gate_mask;
> +};
> +
>  struct ehci_sunxi_priv {
>  	struct ehci_ctrl ehci;
>  	struct sunxi_ccm_reg *ccm;
>  	int ahb_gate_mask; /* Mask of ahb_gate0 clk gate bits for this hcd */

Ideally this should be moved to the ehci_sunxi_cfg (and this is true
for OHCI as well) function for consistency, but that can be done in a
subsequent patch.

It looks good otherwise, thanks!
Maxime

-- 
Maxime Ripard, Bootlin (formerly Free Electrons)
Embedded Linux and Kernel engineering
https://bootlin.com


More information about the U-Boot mailing list