X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Fparport%2Fshare.c;h=a8a62bbbb5769c61446386205c64266887793d5d;hb=301bb4e1433b8b8d8bd084af57c491f0358b4e2b;hp=9cb3ab156b09c40d82477b23f2de41a15e5d3f42;hpb=333c47c847c90aaefde8b593054d9344106333b5;p=linux-2.6-omap-h63xx.git diff --git a/drivers/parport/share.c b/drivers/parport/share.c index 9cb3ab156b0..a8a62bbbb57 100644 --- a/drivers/parport/share.c +++ b/drivers/parport/share.c @@ -17,7 +17,6 @@ #undef PARPORT_DEBUG_SHARING /* undef for production */ -#include #include #include #include @@ -32,6 +31,7 @@ #include #include +#include #include #undef PARPORT_PARANOID @@ -50,7 +50,7 @@ static DEFINE_SPINLOCK(full_list_lock); static LIST_HEAD(drivers); -static DECLARE_MUTEX(registration_lock); +static DEFINE_MUTEX(registration_lock); /* What you can do to a port that's gone away.. */ static void dead_write_lines (struct parport *p, unsigned char b){} @@ -158,11 +158,11 @@ int parport_register_driver (struct parport_driver *drv) if (list_empty(&portlist)) get_lowlevel_driver (); - down(®istration_lock); + mutex_lock(®istration_lock); list_for_each_entry(port, &portlist, list) drv->attach(port); list_add(&drv->list, &drivers); - up(®istration_lock); + mutex_unlock(®istration_lock); return 0; } @@ -188,11 +188,11 @@ void parport_unregister_driver (struct parport_driver *drv) { struct parport *port; - down(®istration_lock); + mutex_lock(®istration_lock); list_del_init(&drv->list); list_for_each_entry(port, &portlist, list) drv->detach(port); - up(®istration_lock); + mutex_unlock(®istration_lock); } static void free_port (struct parport *port) @@ -217,7 +217,7 @@ static void free_port (struct parport *port) * parport_get_port - increment a port's reference count * @port: the port * - * This ensure's that a struct parport pointer remains valid + * This ensures that a struct parport pointer remains valid * until the matching parport_put_port() call. **/ @@ -365,8 +365,13 @@ void parport_announce_port (struct parport *port) parport_daisy_init(port); #endif + if (!port->dev) + printk(KERN_WARNING "%s: fix this legacy " + "no-device port driver!\n", + port->name); + parport_proc_register(port); - down(®istration_lock); + mutex_lock(®istration_lock); spin_lock_irq(&parportlist_lock); list_add_tail(&port->list, &portlist); for (i = 1; i < 3; i++) { @@ -383,7 +388,7 @@ void parport_announce_port (struct parport *port) if (slave) attach_driver_chain(slave); } - up(®istration_lock); + mutex_unlock(®istration_lock); } /** @@ -409,7 +414,7 @@ void parport_remove_port(struct parport *port) { int i; - down(®istration_lock); + mutex_lock(®istration_lock); /* Spread the word. */ detach_driver_chain (port); @@ -436,7 +441,7 @@ void parport_remove_port(struct parport *port) } spin_unlock(&parportlist_lock); - up(®istration_lock); + mutex_unlock(®istration_lock); parport_proc_unregister(port); @@ -519,7 +524,7 @@ void parport_remove_port(struct parport *port) struct pardevice * parport_register_device(struct parport *port, const char *name, int (*pf)(void *), void (*kf)(void *), - void (*irq_func)(int, void *, struct pt_regs *), + void (*irq_func)(void *), int flags, void *handle) { struct pardevice *tmp; @@ -990,6 +995,15 @@ void parport_release(struct pardevice *dev) } } +irqreturn_t parport_irq_handler(int irq, void *dev_id) +{ + struct parport *port = dev_id; + + parport_generic_irq(port); + + return IRQ_HANDLED; +} + /* Exported symbols for modules. */ EXPORT_SYMBOL(parport_claim); @@ -1002,8 +1016,10 @@ EXPORT_SYMBOL(parport_register_driver); EXPORT_SYMBOL(parport_unregister_driver); EXPORT_SYMBOL(parport_register_device); EXPORT_SYMBOL(parport_unregister_device); +EXPORT_SYMBOL(parport_get_port); EXPORT_SYMBOL(parport_put_port); EXPORT_SYMBOL(parport_find_number); EXPORT_SYMBOL(parport_find_base); +EXPORT_SYMBOL(parport_irq_handler); MODULE_LICENSE("GPL");