[PATCH] ARM: mvebu: use system controller to get the soc id when possible

Arnd Bergmann arnd at arndb.de
Fri Jun 20 07:11:38 PDT 2014


On Friday 20 June 2014 16:06:14 Gregory CLEMENT wrote:
> +int mvebu_systeme_controller_get_soc_id(u32 *dev, u32 *rev)

s/systeme/system/

> +{
> +       if (of_machine_is_compatible("marvell,armada38x") &&
> +               system_controller_base) {
> +               *dev = readl(system_controller_base + mvebu_sc->dev_id) >> 16;
> +               *rev = (readl(system_controller_base + mvebu_sc->rev_id) >> 8)
> +                       & 0xF;
> +               return 0;
> +       } else
> +               return -1;
> +}

Better return a proper errno code here rather than -1. How about -ENODEV?

	Arnd



More information about the linux-arm-kernel mailing list