[U-Boot] [PATCH V6 02/10] drivers/usb/host/ohci-hcd: undef readl/writel before redefining

Kumar Gala galak at kernel.crashing.org
Wed Jun 30 11:34:31 CEST 2010


On Jun 25, 2010, at 2:52 PM, Remy Bohmer wrote:

> Hi Becky,
> 
> 2010/6/17 Becky Bruce <beckyb at kernel.crashing.org>:
>> This avoids a build warning that you see if anyone in the
>> header chain has included io.h (which is coming shortly).  I
>> also move this to the "ohci.h" header file in the same dir,
>> which is cleaner.
> 
> As mentioned before, I do not like the undef's. Probably this would
> result in a cleaner patch:
> sed -i 's at writel@ohci_writel at g;s at readl@ohci_readl at g' drivers/usb/host/ohci-hcd.c
> 
> Kind regards,
> 
> Remy
> 
>> 
>> Signed-off-by: Becky Bruce <beckyb at kernel.crashing.org>
>> ---
>>  drivers/usb/host/ohci-hcd.c |   11 -----------
>>  drivers/usb/host/ohci.h     |   13 +++++++++++++
>>  2 files changed, 13 insertions(+), 11 deletions(-)
>> 
>> diff --git a/drivers/usb/host/ohci-hcd.c b/drivers/usb/host/ohci-hcd.c
>> index b03a600..3ffdc9d 100644
>> --- a/drivers/usb/host/ohci-hcd.c
>> +++ b/drivers/usb/host/ohci-hcd.c
>> @@ -83,17 +83,6 @@
>>  #define OHCI_CONTROL_INIT \
>>        (OHCI_CTRL_CBSR & 0x3) | OHCI_CTRL_IE | OHCI_CTRL_PLE
>> 
>> -/*
>> - * e.g. PCI controllers need this
>> - */
>> -#ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS
>> -# define readl(a) __swap_32(*((volatile u32 *)(a)))
>> -# define writel(a, b) (*((volatile u32 *)(b)) = __swap_32((volatile u32)a))
>> -#else
>> -# define readl(a) (*((volatile u32 *)(a)))
>> -# define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
>> -#endif /* CONFIG_SYS_OHCI_SWAP_REG_ACCESS */
>> -
>>  #define min_t(type, x, y) \
>>                    ({ type __x = (x); type __y = (y); __x < __y ? __x: __y; })
>> 
>> diff --git a/drivers/usb/host/ohci.h b/drivers/usb/host/ohci.h
>> index 79aa79d..fa4ecc8 100644
>> --- a/drivers/usb/host/ohci.h
>> +++ b/drivers/usb/host/ohci.h
>> @@ -7,6 +7,19 @@
>>  * usb-ohci.h
>>  */
>> 
>> +/*
>> + * e.g. PCI controllers need this
>> + */
>> +#undef readl
>> +#undef writel
>> +#ifdef CONFIG_SYS_OHCI_SWAP_REG_ACCESS
>> +# define readl(a) __swap_32(*((volatile u32 *)(a)))
>> +# define writel(a, b) (*((volatile u32 *)(b)) = __swap_32((volatile u32)a))
>> +#else
>> +# define readl(a) (*((volatile u32 *)(a)))
>> +# define writel(a, b) (*((volatile u32 *)(b)) = ((volatile u32)a))
>> +#endif /* CONFIG_SYS_OHCI_SWAP_REG_ACCESS */
>> +
>>  /* functions for doing board or CPU specific setup/cleanup */
>>  extern int usb_board_init(void);
>>  extern int usb_board_stop(void);
>> --
>> 1.6.0.6

Becky,

You plan on updating this patch?

- k


More information about the U-Boot mailing list