Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145475
b: refs/heads/master
c: 05ad709
h: refs/heads/master
i:
  145473: 0a9caab
  145471: f826d57
v: v3
  • Loading branch information
Alan Cox authored and Linus Torvalds committed Jun 2, 2009
1 parent 08e3411 commit a264719
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: d3ae33efb8e2f277f9007eb060c9d0b91ab38ae1
refs/heads/master: 05ad709d04799125ed85dd816fdb558258102172
13 changes: 10 additions & 3 deletions trunk/drivers/parport/share.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 4 additions & 0 deletions trunk/include/linux/parport.h
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,10 @@ struct parport {
int spintime;
atomic_t ref_count;

unsigned long devflags;
#define PARPORT_DEVPROC_REGISTERED 0
struct pardevice *proc_device; /* Currently register proc device */

struct list_head full_list;
struct parport *slaves[3];
};
Expand Down

0 comments on commit a264719

Please sign in to comment.