From: Anton Vorontsov <cbouatmailru@gmail.com>
To: Arnd Bergmann <arnd@arndb.de>
Cc: linuxppc-dev@ozlabs.org
Subject: Re: [PATCH 3/4] [POWERPC] CPM2: implement GPIO API
Date: Sat, 22 Dec 2007 02:58:02 +0300 [thread overview]
Message-ID: <20071221235802.GA3651@zarina> (raw)
In-Reply-To: <200712212216.32922.arnd@arndb.de>
On Fri, Dec 21, 2007 at 10:16:32PM +0100, Arnd Bergmann wrote:
> On Friday 21 December 2007, Anton Vorontsov wrote:
> >
> > +static spinlock_t cpm2_port_lock = __SPIN_LOCK_UNLOCKED(cpm2_port_lock);
>
> This needs to be
>
> static DEFINE_SPINLOCK(cpm2_port_lock);
These are equivalents.
#define DEFINE_SPINLOCK(x) spinlock_t x = __SPIN_LOCK_UNLOCKED(x)
> I think at least lockdep doesn't work the way you do it here.
Is it anyhow special regarding what exact macro is used?..
spinlocks.txt says:
SPIN_LOCK_UNLOCKED and RW_LOCK_UNLOCKED defeat lockdep state tracking and
are hence deprecated.
Please use DEFINE_SPINLOCK()/DEFINE_RWLOCK() or
__SPIN_LOCK_UNLOCKED()/__RW_LOCK_UNLOCKED() as appropriate for static
initialization.
-
..should be equivalent, though I prefer open-coded version, until
it fits 80 column width. ;-)
> > +int cpm2_init_par_io(void)
> > +{
> > + struct device_node *np;
> > + const u32 *num_ports;
> > +
> > + np = of_find_compatible_node(NULL, NULL, "fsl,cpm2-pario");
> > + if (!np)
> > + return -ENOENT;
> > +
> > + num_ports = of_get_property(np, "num-ports", NULL);
> > + if (!num_ports) {
> > + of_node_put(np);
> > + return -ENOENT;
> > + }
> > + cpm2_num_ports = *num_ports;
> > +
> > + np->data = &of_gpio_chip;
> > +
> > + return 0;
> > +}
>
> This function should also do the call to of_iomap, so you don't
> need to pull the address out of the cpm2_immr, which I believe
> we're trying to get rid of.
Yup, thanks!
--
Anton Vorontsov
email: cbou@mail.ru
backup email: ya-cbou@yandex.ru
irc://irc.freenode.net/bd2
next prev parent reply other threads:[~2007-12-22 0:08 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-12-21 20:28 [PATCH 0/4] PowerPC: implement GPIO API Anton Vorontsov
2007-12-21 20:31 ` [PATCH 1/4] [POWERPC] Implement GPIO API embryo Anton Vorontsov
2007-12-23 2:49 ` Segher Boessenkool
2007-12-23 3:40 ` David Gibson
2007-12-23 10:00 ` Segher Boessenkool
2007-12-21 20:31 ` [PATCH 2/4] [POWERPC] QE: implement GPIO API Anton Vorontsov
2007-12-21 20:31 ` [PATCH 3/4] [POWERPC] CPM2: " Anton Vorontsov
2007-12-21 21:16 ` Arnd Bergmann
2007-12-21 23:58 ` Anton Vorontsov [this message]
2007-12-21 20:34 ` [PATCH 4/4] [POWERPC] CPM1: " Anton Vorontsov
2007-12-22 9:54 ` Jochen Friedrich
2007-12-22 16:08 ` Jochen Friedrich
2007-12-22 18:38 ` Anton Vorontsov
2007-12-21 20:50 ` [PATCH 0/4] PowerPC: " Grant Likely
2007-12-21 21:04 ` Anton Vorontsov
2007-12-21 21:17 ` Grant Likely
2007-12-22 0:16 ` Anton Vorontsov
2007-12-23 2:47 ` Segher Boessenkool
2007-12-23 3:37 ` David Gibson
2007-12-23 9:53 ` Segher Boessenkool
2007-12-23 11:47 ` Anton Vorontsov
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=20071221235802.GA3651@zarina \
--to=cbouatmailru@gmail.com \
--cc=arnd@arndb.de \
--cc=linuxppc-dev@ozlabs.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.