[U-Boot] [PATCH v3 2/4] usb: sunxi: ehci: get rid of ifdefs
Vasily Khoruzhick
anarsoul at gmail.com
Fri Jun 8 15:24:26 UTC 2018
On Fri, Jun 8, 2018 at 7:24 AM, Maxime Ripard <maxime.ripard at bootlin.com> wrote:
> 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.
ahb_gate_mask is per-controller, i.e. it differs for EHCI0 and EHCI1
so it can't be moved to ehci_sunxi_cfg.
> 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