Cyril Chemparathy <[email protected]> writes:
> This patch modifies the pinmux implementation so as to ioremap() the pinmux
> register area on first use.
>
> Signed-off-by: Cyril Chemparathy <[email protected]>
overall, very nice again. one minor nit...
[...]
> diff --git a/arch/arm/mach-davinci/mux.c b/arch/arm/mach-davinci/mux.c
> index e9d530a..28b1b83 100644
> --- a/arch/arm/mach-davinci/mux.c
> +++ b/arch/arm/mach-davinci/mux.c
> @@ -22,6 +22,8 @@
> #include <mach/mux.h>
> #include <mach/common.h>
>
> +static void __iomem *pinmux_base;
> +
> /*
> * Sets the DAVINCI MUX register based on the table
> */
> @@ -29,7 +31,6 @@ int __init_or_module davinci_cfg_reg(const unsigned long
> index)
> {
> static DEFINE_SPINLOCK(mux_spin_lock);
> struct davinci_soc_info *soc_info = &davinci_soc_info;
> - void __iomem *base = soc_info->pinmux_base;
> unsigned long flags;
> const struct mux_config *cfg;
> unsigned int reg_orig = 0, reg = 0;
> @@ -38,6 +39,11 @@ int __init_or_module davinci_cfg_reg(const unsigned long
> index)
> if (!soc_info->pinmux_pins)
> BUG();
>
> + if (!pinmux_base) {
> + pinmux_base = ioremap(soc_info->pinmux_base, SZ_4K);
> + BUG_ON(!pinmux_base);
> + }
> +
Again, should fail more gracefully, and might as well fix BUG right
above this one while you're at it (with a comment in the changelog of
course.)
Kevin
_______________________________________________
Davinci-linux-open-source mailing list
[email protected]
http://linux.davincidsp.com/mailman/listinfo/davinci-linux-open-source