diff options
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 0ebca450ed29..dffa5d4fb298 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c | |||
@@ -614,7 +614,10 @@ parport_register_device(struct parport *port, const char *name, | |||
614 | * pardevice fields. -arca | 614 | * pardevice fields. -arca |
615 | */ | 615 | */ |
616 | port->ops->init_state(tmp, tmp->state); | 616 | port->ops->init_state(tmp, tmp->state); |
617 | parport_device_proc_register(tmp); | 617 | if (!test_and_set_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags)) { |
618 | port->proc_device = tmp; | ||
619 | parport_device_proc_register(tmp); | ||
620 | } | ||
618 | return tmp; | 621 | return tmp; |
619 | 622 | ||
620 | out_free_all: | 623 | out_free_all: |
@@ -646,10 +649,14 @@ void parport_unregister_device(struct pardevice *dev) | |||
646 | } | 649 | } |
647 | #endif | 650 | #endif |
648 | 651 | ||
649 | parport_device_proc_unregister(dev); | ||
650 | |||
651 | port = dev->port->physport; | 652 | port = dev->port->physport; |
652 | 653 | ||
654 | if (port->proc_device == dev) { | ||
655 | port->proc_device = NULL; | ||
656 | clear_bit(PARPORT_DEVPROC_REGISTERED, &port->devflags); | ||
657 | parport_device_proc_unregister(dev); | ||
658 | } | ||
659 | |||
653 | if (port->cad == dev) { | 660 | if (port->cad == dev) { |
654 | printk(KERN_DEBUG "%s: %s forgot to release port\n", | 661 | printk(KERN_DEBUG "%s: %s forgot to release port\n", |
655 | port->name, dev->name); | 662 | port->name, dev->name); |