linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / drivers / parport / share.c
index ea655db..ea62bed 100644 (file)
@@ -42,11 +42,11 @@ unsigned long parport_default_timeslice = PARPORT_DEFAULT_TIMESLICE;
 int parport_default_spintime =  DEFAULT_SPIN_TIME;
 
 static LIST_HEAD(portlist);
-static spinlock_t parportlist_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(parportlist_lock);
 
 /* list of all allocated ports, sorted by ->number */
 static LIST_HEAD(all_ports);
-static spinlock_t full_list_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(full_list_lock);
 
 static LIST_HEAD(drivers);
 
@@ -202,16 +202,11 @@ static void free_port (struct parport *port)
        list_del(&port->full_list);
        spin_unlock(&full_list_lock);
        for (d = 0; d < 5; d++) {
-               if (port->probe_info[d].class_name)
-                       kfree (port->probe_info[d].class_name);
-               if (port->probe_info[d].mfr)
-                       kfree (port->probe_info[d].mfr);
-               if (port->probe_info[d].model)
-                       kfree (port->probe_info[d].model);
-               if (port->probe_info[d].cmdset)
-                       kfree (port->probe_info[d].cmdset);
-               if (port->probe_info[d].description)
-                       kfree (port->probe_info[d].description);
+               kfree(port->probe_info[d].class_name);
+               kfree(port->probe_info[d].mfr);
+               kfree(port->probe_info[d].model);
+               kfree(port->probe_info[d].cmdset);
+               kfree(port->probe_info[d].description);
        }
 
        kfree(port->name);
@@ -306,7 +301,7 @@ struct parport *parport_register_port(unsigned long base, int irq, int dma,
        tmp->ops = ops;
        tmp->physport = tmp;
        memset (tmp->probe_info, 0, 5 * sizeof (struct parport_device_info));
-       tmp->cad_lock = RW_LOCK_UNLOCKED;
+       rwlock_init(&tmp->cad_lock);
        spin_lock_init(&tmp->waitlist_lock);
        spin_lock_init(&tmp->pardevice_lock);
        tmp->ieee1284.mode = IEEE1284_MODE_COMPAT;
@@ -618,9 +613,9 @@ parport_register_device(struct parport *port, const char *name,
        return tmp;
 
  out_free_all:
-       kfree (tmp->state);
+       kfree(tmp->state);
  out_free_pardevice:
-       kfree (tmp);
+       kfree(tmp);
  out:
        parport_put_port (port);
        module_put(port->ops->owner);