All of lore.kernel.org
 help / color / mirror / Atom feed
From: arnd@arndb.de (Arnd Bergmann)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH 5/5] mach-ux500: add a SoC ID (serial) callback for the u8500
Date: Fri, 2 Sep 2011 17:56:07 +0200	[thread overview]
Message-ID: <201109021756.07976.arnd@arndb.de> (raw)
In-Reply-To: <4E60F333.1010902@linaro.org>

On Friday 02 September 2011, Lee Jones wrote:
> > static void __devinit db8500_read_soc_id(struct db8500_dev *dev)
> > {
> >       u32 __iomem *uid = dev->base + U8500_BB_UID_OFFSET;
> >       snprintf(dev->soc_id, sizeof (dev->soc_id), "%08x%08x%08x%08x%08x",
> >               readl(uid[0]), readl(uid[1]), readl(uid[2]), readl(uid[3]), readl(uid[4]));
> > }
> 
> No problem.
> 
> Where did you get dev->base from though?

In this example, db8500_dev would be derived from soc_device. and
get initialized at the time you register it to the soc subsystem.
You clearly have to pass in the base address at some point, so if
there is no device tree, that init function should statically set it,
but you would still avoid spreading the use of these constants all
over the code.

> > The style you use here is preexisting in the db8500 code, but you should
> > not keep adding more of that crap. 
> 
> Not meaning to pass the buck at all, but this isn't my code.
> 
> It's remnant from when I took this over (starting to wish I hadn't ;))

I feel your pain. Sorry that you got dragged in this so deeply when
you only wanted a place to add a tiny bit of information.

> > All the code like 
> > #define db8500_add_i2c0(pdata) \
> >         dbx500_add_i2c(0, U8500_I2C0_BASE, IRQ_DB8500_I2C0, pdata)
> > #define db8500_add_i2c1(pdata) \
> >         dbx500_add_i2c(1, U8500_I2C1_BASE, IRQ_DB8500_I2C1, pdata)
> > 
> > should never really have been there. What you want to do for this is
> > to call this from the code that initializes the db8500 controller, and
> > pass the board specific pdata into the db8500 init function, along
> > with the i2c client data.
> 
> Not my domain. Speak to Linus W. :)

Yes, I understand. I was mostly using this as explanation about where
the problem lies. I'm not expecting you to fix all of the problems
of the platform, but in order to add new code the right way, we have
to agree on how it should have been there to start with.

	Arnd

  reply	other threads:[~2011-09-02 15:56 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-01 12:27 [PATCH 1/5] Framework for exporting System-on-Chip information via sysfs Lee Jones
2011-09-01 12:27 ` [PATCH 2/5] Add documentation for new sysfs devices/soc functionality Lee Jones
2011-09-01 12:27 ` [PATCH 3/5] mach-ux500: export System-on-Chip information ux500 via sysfs Lee Jones
2011-09-02 14:31   ` Arnd Bergmann
2011-09-01 12:27 ` [PATCH 4/5] mach-ux500: move top level platform devices in sysfs to /sys/devices/soc/X Lee Jones
2011-09-01 12:27 ` [PATCH 5/5] mach-ux500: add a SoC ID (serial) callback for the u8500 Lee Jones
2011-09-02 14:22   ` Arnd Bergmann
2011-09-02 15:16     ` Lee Jones
2011-09-02 15:56       ` Arnd Bergmann [this message]
2011-09-01 23:34 ` [PATCH 1/5] Framework for exporting System-on-Chip information via sysfs Greg KH
2011-09-02  8:44   ` Lee Jones
2011-09-02  9:29     ` Jamie Iles
2011-09-02  9:37       ` Lee Jones
2011-09-02  9:56         ` Jamie Iles
2011-09-02 16:31     ` Greg KH
2011-09-02 17:22       ` Arnd Bergmann
2011-09-02 18:14         ` Greg KH
2011-09-06  9:41       ` Lee Jones
2011-09-06 19:33         ` Arnd Bergmann
2011-09-06 19:45         ` Greg KH
2011-09-07  6:14           ` Lee Jones
2011-09-02 14:02   ` Arnd Bergmann
2011-09-02 16:24     ` Greg KH
2011-09-02 17:32       ` Arnd Bergmann

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=201109021756.07976.arnd@arndb.de \
    --to=arnd@arndb.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.