All of lore.kernel.org
 help / color / mirror / Atom feed
From: u.kleine-koenig@pengutronix.de (Uwe Kleine-König)
To: linux-arm-kernel@lists.infradead.org
Subject: New Kirkwood board support
Date: Thu, 28 Oct 2010 21:50:14 +0200	[thread overview]
Message-ID: <20101028195014.GD31158@pengutronix.de> (raw)
In-Reply-To: <4CC9CFF9.3070808@kernelconcepts.de>

Hello Nils,

On Thu, Oct 28, 2010 at 09:33:13PM +0200, Nils Faerber wrote:
> Am 28.10.2010 21:01, schrieb Uwe Kleine-K?nig:
> > On Thu, Oct 28, 2010 at 08:34:45PM +0200, Nils Faerber wrote:
> >>  arch/arm/configs/tk71_defconfig     | 1700 +++++++++++++++++++++++++++++++++++
> > I'm sure we're not taking new defconfigs now.  Can you add your machine
> > to an existing defconfig?  Moreover it's not reduced.  You need to do at
> 
> Hmm... I have to look at the others. Probably a good idea.
> 
> > least:
> > 	make tk71_defconfig
> > 	make savedefconfig
> > 	mv defconfig arch/arm/configs/tk71_defconfig
> 
> OK, thanks, will check that out!
> 
> >> +	/* eth1 */
> >> +	if (gpio_request(28, "PHY2 reset") != 0 ||
> >> +		gpio_direction_input(28) != 0) // high-z
> > I don't know if it's usually in mach-kirkwood to write it this way, but
> > I think it can be done in a more readable way.
> 
> Most importantly I juts saw a remaining "//" comment - oops!
Do you know scripts/checkpatch.pl?  It should warn about these comments
and some more things.
 
> But how more readable should I do that? The pin is assigned to the gpio
> system (which is IMHO a good idea) and those line should make it high
> impedance. This has nothing much to do with kirkwood I think.
I think the usuals kernel style is something like:

	#define TK71_GPIO_PHY2_RESET 28
	static inline int tk71_setup_phy2_reset(void)
	{
		int ret = gpio_request(TK71_GPIO_PHY2_RESET, "PHY2 reset");
		if (ret)
			goto err_request_phy2_reset;
		
		ret = gpio_direction_input(TK71_GPIO_PHY2_RESET);
		if (ret) 
	err_request_phy2_reset:
			pr_err("something\n");

		return ret;
	}

It's a bit more verbose, but (IMHO) easier so parse.

> >> +		printk(KERN_ERR "can't deassert GPIO 28 (PHY2 reset)\n");
> > pr_err maybe?
> 
> Well - sure, could take that too, OK.
You can even define pr_fmt to something sensible to get a common prefix
for all pr_xyz.

> 
> >> +MACHINE_START(TK71, "TK71 Kirkwood based Q7 formfactor board")
> >> +	/* Maintainer: Nils Faerber <nils.faerber@kernelconcepts.de> */
> >> +	.phys_io	= KIRKWOOD_REGS_PHYS_BASE,
> >> +	.io_pg_offst	= ((KIRKWOOD_REGS_VIRT_BASE) >> 18) & 0xfffc,
> > These fields don't exist anymore.
> 
> Oh really? Which more exactly? I miss to see the difference with other
> boards in the mach-kirkwood/ subdir.
Then you didn't have the corresponding commit yet.

See http://git.kernel.org/linus/6451d7783ba5ff24eb1a544eaa6665b890f30466
.  (This is post-2.6.36 material.)
 
Liebe Gr??e
Uwe

-- 
Pengutronix e.K.                           | Uwe Kleine-K?nig            |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |

  reply	other threads:[~2010-10-28 19:50 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-28 18:34 New Kirkwood board support Nils Faerber
2010-10-28 19:01 ` Uwe Kleine-König
2010-10-28 19:33   ` Nils Faerber
2010-10-28 19:50     ` Uwe Kleine-König [this message]
2010-10-28 19:36   ` Nils Faerber
2010-10-28 19:43     ` Russell King - ARM Linux
2010-10-28 19:56       ` Nils Faerber

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=20101028195014.GD31158@pengutronix.de \
    --to=u.kleine-koenig@pengutronix.de \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.