login
Login
/
Register
Search
Search this site:
Forums
News
Blogs
Features
Site
Home
»
Mailing list archives
»
linux-kernel
»
2008
»
July
»
3
Re: [PATCH] gpiolib: Allow user-selection
view
thread
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
[view in full thread]
From: Michael Buesch
Subject:
Re: [PATCH] gpiolib: Allow user-selection
Date: Thursday, July 3, 2008 - 1:42 am
On Thursday 03 July 2008 10:25:08 David Brownell wrote:
quoted text
> On Wednesday 02 July 2008, Andrew Morton wrote: > > drivers/gpio/gpiolib.c: In function 'gpio_export': > > drivers/gpio/gpiolib.c:432: error: 'struct class' has no member named 'devices' > > drivers/gpio/gpiolib.c:456: error: implicit declaration of function 'device_create' > > drivers/gpio/gpiolib.c:457: warning: assignment makes pointer from integer without a cast > > drivers/gpio/gpiolib.c: In function 'gpio_unexport': > > drivers/gpio/gpiolib.c:509: warning: passing argument 2 of 'class_find_device' from incompatible pointer type > > drivers/gpio/gpiolib.c:509: error: too few arguments to function 'class_find_device' > > drivers/gpio/gpiolib.c: In function 'gpiochip_export': > > drivers/gpio/gpiolib.c:536: error: 'struct class' has no member named 'devices' > > drivers/gpio/gpiolib.c:542: warning: assignment makes pointer from integer without a cast > > drivers/gpio/gpiolib.c: In function 'gpiochip_unexport': > > drivers/gpio/gpiolib.c:575: warning: passing argument 2 of 'class_find_device' from incompatible pointer type > > drivers/gpio/gpiolib.c:575: error: too few arguments to function 'class_find_device' > > Should be addressed by the following, at least in > terms of build problems aginst linux-next. > > The resulting kernel doesn't seem bootable on any > board I currently have set up for testing gpio calls. > The build dies in the TTY stack.
Thanks a lot Dave. I'm going to try this with my bt878 card, once I got linux-next pulled and built.
quoted text
> - Dave > > > ============= CUT HERE > Cope with some backwards-incompatible driver model API changes > now in the linux-next tree: > > - device_create() is going away, even for drivers using it safely, > in favor of device_create_drvdata(). > - class->devices is gone, but testing class->p serves the same > purpose (non-null when class is usable with driver model calls). > - class_find_device() needs a new argument #2 (NULL) > > Signed-off-by: David Brownell <dbrownell@users.sourceforge.net> > --- > drivers/gpio/gpiolib.c | 16 +++++++--------- > 1 file changed, 7 insertions(+), 9 deletions(-) > > --- a/drivers/gpio/gpiolib.c 2008-07-02 23:29:58.000000000 -0700 > +++ b/drivers/gpio/gpiolib.c 2008-07-03 00:04:57.000000000 -0700 > @@ -429,7 +429,7 @@ int gpio_export(unsigned gpio, bool dire > int status = -EINVAL; > > /* can't export until sysfs is available ... */ > - if (!gpio_class.devices.next) { > + if (!gpio_class.p) { > pr_debug("%s: called too early!\n", __func__); > return -ENOENT; > } > @@ -453,10 +453,9 @@ int gpio_export(unsigned gpio, bool dire > if (status == 0) { > struct device *dev; > > - dev = device_create(&gpio_class, desc->chip->dev, 0, > - "gpio%d", gpio); > + dev = device_create_drvdata(&gpio_class, desc->chip->dev, 0, > + desc, "gpio%d", gpio); > if (dev) { > - dev_set_drvdata(dev, desc); > if (direction_may_change) > status = sysfs_create_group(&dev->kobj, > &gpio_attr_group); > @@ -506,7 +505,7 @@ void gpio_unexport(unsigned gpio) > if (test_bit(FLAG_EXPORT, &desc->flags)) { > struct device *dev = NULL; > > - dev = class_find_device(&gpio_class, desc, match_export); > + dev = class_find_device(&gpio_class, NULL, desc, match_export); > if (dev) { > clear_bit(FLAG_EXPORT, &desc->flags); > put_device(dev); > @@ -533,15 +532,14 @@ static int gpiochip_export(struct gpio_c > * export this later, in gpiolib_sysfs_init() ... here we just > * verify that _some_ field of gpio_class got initialized. > */ > - if (!gpio_class.devices.next) > + if (!gpio_class.p) > return 0; > > /* use chip->base for the ID; it's already known to be unique */ > mutex_lock(&sysfs_lock); > - dev = device_create(&gpio_class, chip->dev, 0, > + dev = device_create_drvdata(&gpio_class, chip->dev, 0, chip, > "gpiochip%d", chip->base); > if (dev) { > - dev_set_drvdata(dev, chip); > status = sysfs_create_group(&dev->kobj, > &gpiochip_attr_group); > } else > @@ -572,7 +570,7 @@ static void gpiochip_unexport(struct gpi > struct device *dev; > > mutex_lock(&sysfs_lock); > - dev = class_find_device(&gpio_class, chip, match_export); > + dev = class_find_device(&gpio_class, NULL, chip, match_export); > if (dev) { > put_device(dev); > device_unregister(dev); > > >
-- Greetings Michael. --
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [
thread
] [
date
] [
author
]
Messages in current thread:
[PATCH] gpiolib: Allow user-selection
, Michael Buesch
, (Wed Jul 2, 2:46 pm)
Re: [PATCH] gpiolib: Allow user-selection
, Andrew Morton
, (Wed Jul 2, 5:04 pm)
Re: [PATCH] gpiolib: Allow user-selection
, Michael Buesch
, (Wed Jul 2, 5:26 pm)
Re: [PATCH] gpiolib: Allow user-selection
, David Brownell
, (Wed Jul 2, 10:00 pm)
Re: [PATCH] gpiolib: Allow user-selection
, Andrew Morton
, (Wed Jul 2, 10:08 pm)
Re: [PATCH] gpiolib: Allow user-selection
, David Brownell
, (Wed Jul 2, 10:41 pm)
Re: [PATCH] gpiolib: Allow user-selection
, David Brownell
, (Thu Jul 3, 1:25 am)
Re: [PATCH] gpiolib: Allow user-selection
, Rene Herman
, (Thu Jul 3, 1:36 am)
Re: [PATCH] gpiolib: Allow user-selection
, Michael Buesch
, (Thu Jul 3, 1:42 am)
Re: [PATCH] gpiolib: Allow user-selection
, Andrew Morton
, (Thu Jul 3, 2:01 am)
Re: [PATCH] gpiolib: Allow user-selection
, Rene Herman
, (Thu Jul 3, 3:19 am)
Re: [PATCH] gpiolib: Allow user-selection
, Greg KH
, (Thu Jul 3, 12:37 pm)
Re: [PATCH] gpiolib: Allow user-selection
, David Brownell
, (Thu Jul 3, 2:28 pm)
Re: [PATCH] gpiolib: Allow user-selection
, Greg KH
, (Thu Jul 3, 4:08 pm)
Re: [PATCH] gpiolib: Allow user-selection
, David Brownell
, (Fri Jul 11, 10:32 pm)
Navigation
Mailing list archives
Recent posts
Popular discussions
linux-kernel
:
Ken Chen
[patch] sched: fix inconsistency when redistribute per-cpu tg->cfs_rq shares.
Ingo Molnar
Re: [PATCH v3] x86: merge the simple bitops and move them to bitops.h
Paul Turner
[tg_shares_up rewrite v4 11/11] sched: update tg->shares after cpu.shares write
Andi Kleen
Re: - romsignature-checksum-cleanup-2.patch removed from -mm tree
Stefano Stabellini
Re: [PATCH 09/22] xen: Find an unbound irq number in reverse order (high to low).
git
:
Junio C Hamano
Re: Teach "git checkout" to use git-show-ref
Christian Jaeger
Re: Problem with Git.pm bidi_pipe methods
Linus Torvalds
[PATCH 1/7] Make unpack_trees_options bit flags actual bitfields
Jon Smirl
stgit: managing signed-off-by lines
Junio C Hamano
GIT 1.4.3-rc2
git-commits-head
:
Linux Kernel Mailing List
MIPS: Bonito64: Make Loongson independent from Bonito64 code.
Linux Kernel Mailing List
iwlwifi: initialize spinlock before use
Linux Kernel Mailing List
i2c-i801: Add Intel Cougar Point device IDs
Linux Kernel Mailing List
drm/i915: Add information on pinning and fencing to the i915 list debug.
Linux Kernel Mailing List
cirrusfb: GD5434 (aka SD64) support fixed
linux-netdev
:
Gerrit Renker
v2 [PATCH 1/4] dccp: Limit feature negotiation to connection setup phase
Richard Cochran
Re: [PATCH v3 3/3] ptp: Added a clock that uses the eTSEC found on the MPC85xx.
Inaky Perez-Gonzalez
[PATCH 40/40] wimax/i2400m: add CREDITS and MAINTAINERS entries
Sathya Perla
[PATCH net-next-2.6] be2net: add multiple RX queue support
Changli Gao
Re: [PATCH 3/3] ifb: move tq from ifb_private
freebsd-current
:
Boris Samorodov
Re: twa + dump = sbwait
韓家標 Bill Hacker
Re: ZFS honesty
Bjoern A. Zeeb
Re: Can not boot 7.0-BETA3 with IPSEC
rmgls
man usb2_core(4)
Sam Leffler
Re: Lots of "ath0: bad series0 hwrate 0x1b" in 8.0-BETA2
Colocation donated by:
Syndicate