Re: [PATCH 1/2] leds: bcm6328: improve write and read functions
From: Pavel Machek
Date: Tue Feb 23 2021 - 03:35:41 EST
On Tue 2021-02-23 09:17:31, Álvaro Fernández Rojas wrote:
> This is proven to work in BMIPS BE/LE and ARM BE/LE, as used in bcm2835-rng
> and bcmgenet drivers.
> Both should also be inline functions.
> -#ifdef CONFIG_CPU_BIG_ENDIAN
> - iowrite32be(data, reg);
> -#else
> - writel(data, reg);
> -#endif
> + /* MIPS chips strapped for BE will automagically configure the
> + * peripheral registers for CPU-native byte order.
> + */
Bad comment style.
> + if (IS_ENABLED(CONFIG_MIPS) && IS_ENABLED(CONFIG_CPU_BIG_ENDIAN))
> + __raw_writel(data, reg);
> + else
> + writel_relaxed(data, reg);
> }
Code does not match comment (still need to do conversion on
non-MIPS?), and it certainly should not be here (do all mipsen behave
like that?!), and it really should not be converting to _relaxed at
the same time.
Best regards,
Pavel
--
http://www.livejournal.com/~pavelmachek
Attachment:
signature.asc
Description: Digital signature