From 8d19538bd5e7aa71ff8dac5fbd272bdc17ad6311 Mon Sep 17 00:00:00 2001 From: Alexander Viro Date: Wed, 4 Feb 2004 16:58:34 -0800 Subject: [PATCH] parport fixes (1/6) Current tree has all allocated ports on portlist. However, most of the portlist users assume that we only have announced ports there and break badly if they happen to see the list after port driver has created a port (parport_register_port()) but before it finishes the setup (and calls parport_announce_port()). The only place that wants to see all allocated port is parport_register_port() itself and only to pick the first unused port number. We add a new list (all_ports) and put ports there when allocated; that list is kept ordered by port->number. Ports are placed on portlist only by parport_announce_port(). Gobs of shite in parport_register_port() removed, pile of races closed... --- include/linux/parport.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'include') diff --git a/include/linux/parport.h b/include/linux/parport.h index 77e99e8eace2..eff925bb5da6 100644 --- a/include/linux/parport.h +++ b/include/linux/parport.h @@ -311,6 +311,8 @@ struct parport { int spintime; atomic_t ref_count; + + struct list_head full_list; }; #define DEFAULT_SPIN_TIME 500 /* us */ -- cgit v1.2.3