linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: baruch@tkos.co.il (Baruch Siach)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] ARM: mxs: Add initial support for Bluegiga APX4 Development Kit
Date: Mon, 17 Oct 2011 12:39:58 +0200	[thread overview]
Message-ID: <20111017103958.GD7761@tarshish> (raw)
In-Reply-To: <20111017094434.GA21504@pengutronix.de>

Hi Uwe, Lauri,
On Mon, Oct 17, 2011 at 11:44:34AM +0200, Uwe Kleine-K?nig wrote:
> Hello,
> 
> On Mon, Oct 17, 2011 at 11:08:36AM +0300, Lauri Hintsala wrote:
> > Added initial support for Bluegiga APX4 module and Development Kit.
> > Patches are based on Linux v3.1-rc9.

[snip]

> > +static int __init apx4devkit_fec_get_mac(char *macstr)
> > +{
> > +	int i, h, l;
> > +
> > +	macstr++;
> > +
> > +	for (i = 0; i < 6; i++) {
> > +		if (i != 5 && *(macstr + 2) != ':')
> > +			goto error;
> > +
> > +		h = hex_to_bin(*macstr++);
> > +		if (h == -1)
> > +			goto error;
> > +
> > +		l = hex_to_bin(*macstr++);
> > +		if (l == -1)
> > +			goto error;
> > +
> > +		macstr++;
> > +		mx28_fec_pdata.mac[i] = (h << 4) + l;
> > +	}
> > +	return 0;
> I wonder if there isn't a more generic way to parse a mac address.
> 
> Other machines put the mac into the otp.
> 
> > +error:
> > +	pr_err("%s: invalid mac address\n", __func__);
> > +	return -EINVAL;
> > +}
> > +
> > +__setup("ethaddr", apx4devkit_fec_get_mac);
> the name is IMHO too generic for a board specific parameter. Think about
> a kernel that runs on all mxs based machines. ethaddr=... only affects
> your machine type. And it's not possible to add the same parameter to a
> different board.

The fec driver already supports the macaddr module parameter. See the comment 
at the beginning of the fec_get_mac() routine in drivers/net/fec.c.

baruch

-- 
                                                     ~. .~   Tk Open Systems
=}------------------------------------------------ooO--U--Ooo------------{=
   - baruch at tkos.co.il - tel: +972.2.679.5364, http://www.tkos.co.il -

  reply	other threads:[~2011-10-17 10:39 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-17  8:08 [PATCH] ARM: mxs: Add initial support for Bluegiga APX4 Development Kit Lauri Hintsala
2011-10-17  9:44 ` Uwe Kleine-König
2011-10-17 10:39   ` Baruch Siach [this message]
2011-10-18  7:45     ` Lauri Hintsala
2011-10-18  7:58       ` Baruch Siach
2011-10-18  9:34         ` Lauri Hintsala
2011-10-18 12:54           ` Baruch Siach
2011-10-18  7:27   ` Lauri Hintsala
2011-10-18  7:39     ` Uwe Kleine-König
2011-10-18  8:01       ` Lauri Hintsala
2011-10-18  8:12         ` Uwe Kleine-König

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111017103958.GD7761@tarshish \
    --to=baruch@tkos.co.il \
    --cc=linux-arm-kernel@lists.infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).