[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1356560680.26650.15.camel@joe-AO722>
Date: Wed, 26 Dec 2012 14:24:40 -0800
From: Joe Perches <joe@...ches.com>
To: Rafał Miłecki <zajec5@...il.com>
Cc: netdev@...r.kernel.org, "David S. Miller" <davem@...emloft.net>
Subject: Re: [PATCH] bgmac: driver for GBit MAC core on BCMA bus
On Mon, 2012-12-24 at 16:33 +0100, Rafał Miłecki wrote:
> BCMA is a Broadcom specific bus with devices AKA cores. All recent BCMA
> based SoCs have gigabit ethernet provided by the GBit MAC core. This
> patch adds driver for such a cores registering itself as a netdev. It
> has been tested on a BCM4706 and BCM4718 chipsets.
Just a trivial note:
> diff --git a/drivers/net/ethernet/broadcom/bgmac.h b/drivers/net/ethernet/broadcom/bgmac.h
[]
> @@ -0,0 +1,443 @@
> +#ifndef _BGMAC_H
> +#define _BGMAC_H
> +
> +#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> +
> +#define bgmac_err(bgmac, fmt, ...) \
> + pr_err("u%d: " fmt, (bgmac)->core->core_unit, ##__VA_ARGS__)
> +#define bgmac_warn(bgmac, fmt, ...) \
> + pr_warn("u%d: " fmt, (bgmac)->core->core_unit, ##__VA_ARGS__)
> +#define bgmac_info(bgmac, fmt, ...) \
> + pr_info("u%d: " fmt, (bgmac)->core->core_unit, ##__VA_ARGS__)
> +#define bgmac_dbg(bgmac, fmt, ...) \
> + pr_debug("u%d: " fmt, (bgmac)->core->core_unit, ##__VA_ARGS__)
Maybe all the bgmac_<level> macros should be:
dev_<level>(&bgmac->core->dev, "u%d: " fmt,
(bgmac)->core->core_unit, ##__VA_ARGS)
or maybe a new function like below if you use
a lot of these to decrease object size a little.
int bgmac_printk(const char *level, const struct bgmac *bgmac,
const char *fmt, ...)
{
struct va_format vaf;
va_list args;
int r;
va_start(args, fmt);
vaf.fmt = fmt;
vaf.va = &args;
r = dev_printk(&bgmac->core->dev, "u%d: %pV",
bgmac->core->core_unit, &vaf);
va_end(args);
return r;
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists