linux-mips
[Top] [All Lists]

Re: [RFC][PATCH 03/10] bcma: add embedded bus

To: Hauke Mehrtens <hauke@hauke-m.de>
Subject: Re: [RFC][PATCH 03/10] bcma: add embedded bus
From: Julian Calaby <julian.calaby@gmail.com>
Date: Mon, 6 Jun 2011 09:22:56 +1000
Cc: linux-wireless@vger.kernel.org, linux-mips@linux-mips.org, zajec5@gmail.com, mb@bu3sch.de, george@znau.edu.ua, arend@broadcom.com, b43-dev@lists.infradead.org, bernhardloos@googlemail.com
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-type:content-transfer-encoding; bh=bw2QYFd8KM0cNRRZtkinbeQSYFIDVmOI8ZdINVvO3UE=; b=JgizzoJBO1nzuoywPzhkKpmtjbACNdQFG9DnpH6+A7YeST1+oBz9fAtzhVc1HLBHDU lrL0vT3WgMVC/iRB32sqj9MwnRctkrz3bk83fJs5ADicgsHbmx5Big3xtSiYMQR8/Ci2 zqxYFh9ArR3q9cvM/rv2ZYZyCgZo3hFXr/I5Q=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; b=eRQwOBPfrf5n9mPMI1OYANs9LQtEwtv/PkdFjwuQF8IkqzdMaUpMT+7jRVCFLnPaLd g/JLkqOy1mLC/marP3p8Lw2lnxHThCC1dG9o/TFZNQ9lVmAxpWW7Z3ROCY/UjZxTqXlX MdzUl5lEGlZPAQasFvaciDUtUiQeRnCvMmGcc=
In-reply-to: <1307311658-15853-4-git-send-email-hauke@hauke-m.de>
References: <1307311658-15853-1-git-send-email-hauke@hauke-m.de> <1307311658-15853-4-git-send-email-hauke@hauke-m.de>
Sender: linux-mips-bounce@linux-mips.org
Hauke,

Minor nit:

On Mon, Jun 6, 2011 at 08:07, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> This patch adds support for using bcma on an embedded bus. An embedded
> system like the bcm4716 could register this bus and it searches for the
> bcma cores then.
>
> Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
> ---
> diff --git a/drivers/bcma/scan.c b/drivers/bcma/scan.c
> index 70b39f7..9229615 100644
> --- a/drivers/bcma/scan.c
> +++ b/drivers/bcma/scan.c
> @@ -219,9 +219,34 @@ int bcma_bus_scan(struct bcma_bus *bus)
>        bus->chipinfo.id = (tmp & BCMA_CC_ID_ID) >> BCMA_CC_ID_ID_SHIFT;
>        bus->chipinfo.rev = (tmp & BCMA_CC_ID_REV) >> BCMA_CC_ID_REV_SHIFT;
>        bus->chipinfo.pkg = (tmp & BCMA_CC_ID_PKG) >> BCMA_CC_ID_PKG_SHIFT;
> +       bus->nr_cores = (tmp & BCMA_CC_ID_NRCORES) >> 
> BCMA_CC_ID_NRCORES_SHIFT;
> +
> +       /* If we are an embedded device we now know the number of avaliable
> +        * core and ioremap the correct space.
> +        */
> +       if (bus->hosttype == BCMA_HOSTTYPE_EMBEDDED) {
> +               iounmap(bus->mmio);
> +               mmio = ioremap(BCMA_ADDR_BASE, BCMA_CORE_SIZE * 
> bus->nr_cores);
> +               if (!mmio)
> +                       return -ENOMEM;
> +               bus->mmio = mmio;
> +
> +               mmio = ioremap(BCMA_WRAP_BASE, BCMA_CORE_SIZE * 
> bus->nr_cores);
> +               if (!mmio)
> +                       return -ENOMEM;
> +               bus->host_embedded = mmio;
> +       }
> +       /* reset it to 0 as we use it for counting */
> +       bus->nr_cores = 0;

Would it make sense to use a local variable for nr_cores, and only use
it within the BCMA_HOSTTYPE_EMBEDDED if statement, rather than
re-using bus->nr_cores and having to reset it?

Thanks,

-- 
Julian Calaby

Email: julian.calaby@gmail.com
Profile: http://www.google.com/profiles/julian.calaby/
.Plan: http://sites.google.com/site/juliancalaby/

<Prev in Thread] Current Thread [Next in Thread>