mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: Sascha Hauer <s.hauer@pengutronix.de>
Cc: barebox@lists.infradead.org
Subject: Re: [PATCH 1/4] device: update id support to allow device without id
Date: Thu, 18 Aug 2011 08:27:20 +0200	[thread overview]
Message-ID: <20110818062720.GA21635@game.jcrosoft.org> (raw)
In-Reply-To: <20110818052620.GP31404@pengutronix.de>

On 07:26 Thu 18 Aug     , Sascha Hauer wrote:
> On Tue, Aug 16, 2011 at 07:36:04AM +0200, Jean-Christophe PLAGNIOL-VILLARD wrote:
> > as in linux use -1 for this
> > 
> > as example on bus we may have only one device so no need to have
> > devname<number>
> > 
> > for automatic id use -2 now
> > udpate all the device that use -1 to -2
> > 
> > device that really want -1 will have to update later
> > 
> > Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
> > ---
> > diff --git a/arch/arm/boards/a9m2410/a9m2410.c b/arch/arm/boards/a9m2410/a9m2410.c
> > index 44ac44b..0d26da9 100644
> > --- a/arch/arm/boards/a9m2410/a9m2410.c
> > +++ b/arch/arm/boards/a9m2410/a9m2410.c
> > @@ -131,14 +131,14 @@ static int a9m2410_devices_init(void)
> >  	writel(reg, MISCCR);
> >  
> >  	/* ----------- the devices the boot loader should work with -------- */
> > -	add_generic_device("s3c24x0_nand", -1, NULL, S3C24X0_NAND_BASE, 0,
> > +	add_generic_device("s3c24x0_nand", -2, NULL, S3C24X0_NAND_BASE, 0,
> >  			   IORESOURCE_MEM, &nand_info);
> 
> -1 has a special meaning without being a define, but we should not
> introduce another arbitrary numbered special meaning.
we can add a proper define

> 
> But I don't think we want this anyway. In a later patch you convert
> all drivers/devices to platform_*_register without having a
> platform_device. If we want to go this way we should go it all the
> way and have a struct platform_device which embeds a struct device_d.
> The 'id' field would then be a part of the platform_device rather
> than the device itself.
> The 'id' field is only present because we have no better way of
> numbering the instances of devices on a platform bus. With PCI/USB
> devices this numbering would come from the position on the bus.
I chosse to do it in two step for platfrom_device

I first switch everyone to the function and then introduce the new struct
I've not yet finish completly the new struct but it's on its way

Best Regards,
J.

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

  reply	other threads:[~2011-08-18  6:46 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-15  8:46 [PATCH] parent fixups Sascha Hauer
2011-08-15  8:46 ` [PATCH 1/7] mci: embed mci_dev into mci_host instead of allocating it seperately Sascha Hauer
2011-08-15  8:46 ` [PATCH 2/7] net: make the ethernet device a child of the hardware device Sascha Hauer
2011-08-15  8:46 ` [PATCH 3/7] net mii: add a parent pointer to miidevs and set it to " Sascha Hauer
2011-08-15  8:46 ` [PATCH 4/7] console: make console device a child of " Sascha Hauer
2011-08-15  8:46 ` [PATCH 5/7] mci: parent fixups Sascha Hauer
2011-08-16 15:39   ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-15  8:46 ` [PATCH 6/7] spi: make the spi devices children of the parent bus Sascha Hauer
2011-08-15  8:46 ` [PATCH 7/7] devinfo: beautify output Sascha Hauer
2011-08-15  9:14 ` [PATCH] parent fixups Jean-Christophe PLAGNIOL-VILLARD
2011-08-15 15:50   ` Sascha Hauer
2011-08-16  5:29     ` Jean-Christophe PLAGNIOL-VILLARD
2011-08-16  5:36 ` [PATCH 1/4] device: update id support to allow device without id Jean-Christophe PLAGNIOL-VILLARD
2011-08-18  5:26   ` Sascha Hauer
2011-08-18  6:27     ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2011-08-16  5:36 ` [PATCH 2/4] add bus registration support Jean-Christophe PLAGNIOL-VILLARD
2011-08-18  5:14   ` Sascha Hauer
2011-08-16  5:36 ` [PATCH 3/4] platform_bus: add registrattion to bus Jean-Christophe PLAGNIOL-VILLARD
2011-08-16  5:36 ` [PATCH 4/4] switch all device/driver to platform_device/driver_(un)register Jean-Christophe PLAGNIOL-VILLARD

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=20110818062720.GA21635@game.jcrosoft.org \
    --to=plagnioj@jcrosoft.com \
    --cc=barebox@lists.infradead.org \
    --cc=s.hauer@pengutronix.de \
    /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