diff mbox

[U-Boot,v2,1/4] drivers: musb-new: fix compilation error for MIPS.

Message ID 1457356777-4350-1-git-send-email-purna.mandal@microchip.com
State Superseded
Delegated to: Daniel Schwierzeck
Headers show

Commit Message

Purna Chandra Mandal March 7, 2016, 1:19 p.m. UTC
MIPS arch implements writes{b,w,l,q}, reads{b,w,l,q}
whereas other archs implement __raw version of them.
So defining macro writes{bwlq}() to __raw_writes{bwlq}()
(and similarly for reads{bwlq}) is not necessary for MIPS.

Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
---

Changes in v2: None

 drivers/usb/musb-new/linux-compat.h | 2 ++
 1 file changed, 2 insertions(+)

Comments

Daniel Schwierzeck March 7, 2016, 3:48 p.m. UTC | #1
2016-03-07 14:19 GMT+01:00 Purna Chandra Mandal <purna.mandal@microchip.com>:
> MIPS arch implements writes{b,w,l,q}, reads{b,w,l,q}
> whereas other archs implement __raw version of them.
> So defining macro writes{bwlq}() to __raw_writes{bwlq}()
> (and similarly for reads{bwlq}) is not necessary for MIPS.
>
> Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
> ---
>
> Changes in v2: None
>
>  drivers/usb/musb-new/linux-compat.h | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/drivers/usb/musb-new/linux-compat.h b/drivers/usb/musb-new/linux-compat.h
> index 46f83d9..9ac48c1 100644
> --- a/drivers/usb/musb-new/linux-compat.h
> +++ b/drivers/usb/musb-new/linux-compat.h
> @@ -13,12 +13,14 @@
>                 printf(fmt, ##args);            \
>         ret_warn; })
>
> +#if !defined(CONFIG_MIPS)
>  #define writesl(a, d, s) __raw_writesl((unsigned long)a, d, s)
>  #define readsl(a, d, s) __raw_readsl((unsigned long)a, d, s)
>  #define writesw(a, d, s) __raw_writesw((unsigned long)a, d, s)
>  #define readsw(a, d, s) __raw_readsw((unsigned long)a, d, s)
>  #define writesb(a, d, s) __raw_writesb((unsigned long)a, d, s)
>  #define readsb(a, d, s) __raw_readsb((unsigned long)a, d, s)
> +#endif

I guess the current musb-new users are ARM boards only. Thus this
should be moved to arch/arm/asm/io.h. Adding I/O primitives to a
architecture-independent linux-compat.h was wrong from the beginning.

>
>  #define device_init_wakeup(dev, a) do {} while (0)
>
> --
> 1.8.3.1
>
Purna Chandra Mandal March 10, 2016, 11:34 a.m. UTC | #2
On 03/07/2016 09:18 PM, Daniel Schwierzeck wrote:

> 2016-03-07 14:19 GMT+01:00 Purna Chandra Mandal <purna.mandal@microchip.com>:
>> MIPS arch implements writes{b,w,l,q}, reads{b,w,l,q}
>> whereas other archs implement __raw version of them.
>> So defining macro writes{bwlq}() to __raw_writes{bwlq}()
>> (and similarly for reads{bwlq}) is not necessary for MIPS.
>>
>> Signed-off-by: Purna Chandra Mandal <purna.mandal@microchip.com>
>> ---
>>
>> Changes in v2: None
>>
>>  drivers/usb/musb-new/linux-compat.h | 2 ++
>>  1 file changed, 2 insertions(+)
>>
>> diff --git a/drivers/usb/musb-new/linux-compat.h b/drivers/usb/musb-new/linux-compat.h
>> index 46f83d9..9ac48c1 100644
>> --- a/drivers/usb/musb-new/linux-compat.h
>> +++ b/drivers/usb/musb-new/linux-compat.h
>> @@ -13,12 +13,14 @@
>>                 printf(fmt, ##args);            \
>>         ret_warn; })
>>
>> +#if !defined(CONFIG_MIPS)
>>  #define writesl(a, d, s) __raw_writesl((unsigned long)a, d, s)
>>  #define readsl(a, d, s) __raw_readsl((unsigned long)a, d, s)
>>  #define writesw(a, d, s) __raw_writesw((unsigned long)a, d, s)
>>  #define readsw(a, d, s) __raw_readsw((unsigned long)a, d, s)
>>  #define writesb(a, d, s) __raw_writesb((unsigned long)a, d, s)
>>  #define readsb(a, d, s) __raw_readsb((unsigned long)a, d, s)
>> +#endif
> I guess the current musb-new users are ARM boards only. Thus this
> should be moved to arch/arm/asm/io.h. Adding I/O primitives to a
> architecture-independent linux-compat.h was wrong from the beginning.

Makes sense! ARM Linux also defines readsl(or similar) to their __raw
version in arch/arm/include/asm/io.h file.

>>  #define device_init_wakeup(dev, a) do {} while (0)
>>
>> --
>> 1.8.3.1
>>
>
diff mbox

Patch

diff --git a/drivers/usb/musb-new/linux-compat.h b/drivers/usb/musb-new/linux-compat.h
index 46f83d9..9ac48c1 100644
--- a/drivers/usb/musb-new/linux-compat.h
+++ b/drivers/usb/musb-new/linux-compat.h
@@ -13,12 +13,14 @@ 
 		printf(fmt, ##args);		\
 	ret_warn; })
 
+#if !defined(CONFIG_MIPS)
 #define writesl(a, d, s) __raw_writesl((unsigned long)a, d, s)
 #define readsl(a, d, s) __raw_readsl((unsigned long)a, d, s)
 #define writesw(a, d, s) __raw_writesw((unsigned long)a, d, s)
 #define readsw(a, d, s) __raw_readsw((unsigned long)a, d, s)
 #define writesb(a, d, s) __raw_writesb((unsigned long)a, d, s)
 #define readsb(a, d, s) __raw_readsb((unsigned long)a, d, s)
+#endif
 
 #define device_init_wakeup(dev, a) do {} while (0)