diff options
author | Alan Cox <alan@etchedpixels.co.uk> | 2009-06-02 16:58:10 +0100 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-06-02 09:53:22 -0700 |
commit | 05ad709d04799125ed85dd816fdb558258102172 (patch) | |
tree | a2fffcedd4d9178663175dcc3816d86734336505 /drivers/parport/share.c | |
parent | d3ae33efb8e2f277f9007eb060c9d0b91ab38ae1 (diff) | |
download | op-kernel-dev-05ad709d04799125ed85dd816fdb558258102172.zip op-kernel-dev-05ad709d04799125ed85dd816fdb558258102172.tar.gz |
parport: quickfix the proc registration bug
Ideally we should have a directory of drivers and a link to the 'active'
driver. For now just show the first device which is effectively the existing
semantics without a warning.
This is an update on the original buggy patch that I then forgot to
resubmit. Confusingly it was proposed by Red Hat, written by Etched Pixels
fixed and submitted by Intel ...
Resolves-Bug: http://bugzilla.kernel.org/show_bug.cgi?id=9749
Signed-off-by: Alan Cox <alan@linux.intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/parport/share.c')
-rw-r--r-- | drivers/parport/share.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 0ebca45..dffa5d4 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -614,7 +614,10 @@ parport_register_device(struct parport *port, const char *name, * pardevice fields. -arca */ port->ops->init_state(tmp, tmp->state); - parport_device_proc_register(tmp); + if (!test_and_set_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags)) { + port->proc_device = tmp; + parport_device_proc_register(tmp); + } return tmp; out_free_all: @@ -646,10 +649,14 @@ void parport_unregister_device(struct pardevice *dev) } #endif - parport_device_proc_unregister(dev); - port = dev->port->physport; + if (port->proc_device == dev) { + port->proc_device = NULL; + clear_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags); + parport_device_proc_unregister(dev); + } + if (port->cad == dev) { printk(KERN_DEBUG "%s: %s forgot to release port\n", port->name, dev->name); |