RE: [PATCH 2/7] usb: chipidea: add freescale imx28 special write register method

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

 



From: Peter Chen
...
> +#ifdef 
> +static inline void imx28_ci_writel(u32 val, volatile void __iomem *addr)
> +{
> +	__asm__ ("swp %0, %0, [%1]" : : "r"(val), "r"(addr));
> +}
> +#else
> +static inline void imx28_ci_writel(u32 val, volatile void __iomem *addr)
> +{
> +}
> +#endif
> +
> +static inline void __hw_write(struct ci_hdrc *ci, u32 val,
> +		void __iomem *addr)
> +{
> +	if (ci->imx28_write_fix)
> +		imx28_ci_writel(val, addr);
> +	else
> +		iowrite32(val, addr);
> +}
> +

This code ought to be defensive against 'imx28_write_fix' being
set when the kernel isn't compiled with CONFIG_SOC_IMX28.
This can easily be done by changing the #else block to do an iowrite().

It is worth looking to see if the compiler manages to optimise away
the 'if' test in this case. It might do better if a #define is used
instead of the inline function.

	David



--
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