aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/common.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/gigaset/common.c')
-rw-r--r--drivers/isdn/gigaset/common.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/isdn/gigaset/common.c b/drivers/isdn/gigaset/common.c
index e55767b2ccd3..aca165d43aa0 100644
--- a/drivers/isdn/gigaset/common.c
+++ b/drivers/isdn/gigaset/common.c
@@ -460,6 +460,9 @@ void gigaset_freecs(struct cardstate *cs)
switch (cs->cs_init) {
default:
+ /* clear device sysfs */
+ gigaset_free_dev_sysfs(cs);
+
gigaset_if_free(cs);
gig_dbg(DEBUG_INIT, "clearing hw");
@@ -699,6 +702,7 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
cs->open_count = 0;
cs->dev = NULL;
cs->tty = NULL;
+ cs->class = NULL;
cs->cidmode = cidmode != 0;
//if(onechannel) { //FIXME
@@ -760,6 +764,9 @@ struct cardstate *gigaset_initcs(struct gigaset_driver *drv, int channels,
gigaset_if_init(cs);
+ /* set up device sysfs */
+ gigaset_init_dev_sysfs(cs);
+
spin_lock_irqsave(&cs->lock, flags);
cs->running = 1;
spin_unlock_irqrestore(&cs->lock, flags);
@@ -902,9 +909,6 @@ int gigaset_start(struct cardstate *cs)
wait_event(cs->waitqueue, !cs->waiting);
- /* set up device sysfs */
- gigaset_init_dev_sysfs(cs);
-
mutex_unlock(&cs->mutex);
return 1;
@@ -969,9 +973,6 @@ void gigaset_stop(struct cardstate *cs)
//FIXME
}
- /* clear device sysfs */
- gigaset_free_dev_sysfs(cs);
-
cleanup_cs(cs);
exit:
@@ -980,7 +981,7 @@ exit:
EXPORT_SYMBOL_GPL(gigaset_stop);
static LIST_HEAD(drivers);
-static spinlock_t driver_lock = SPIN_LOCK_UNLOCKED;
+static DEFINE_SPINLOCK(driver_lock);
struct cardstate *gigaset_get_cs_by_id(int id)
{
@@ -1091,14 +1092,12 @@ EXPORT_SYMBOL_GPL(gigaset_freedriver);
* minors Number of minors this driver can handle
* procname Name of the driver
* devname Name of the device files (prefix without minor number)
- * devfsname Devfs name of the device files without %d
* return value:
* Pointer to the gigaset_driver structure on success, NULL on failure.
*/
struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
const char *procname,
const char *devname,
- const char *devfsname,
const struct gigaset_ops *ops,
struct module *owner)
{
@@ -1138,7 +1137,7 @@ struct gigaset_driver *gigaset_initdriver(unsigned minor, unsigned minors,
drv->cs[i].minor_index = i;
}
- gigaset_if_initdriver(drv, procname, devname, devfsname);
+ gigaset_if_initdriver(drv, procname, devname);
spin_lock_irqsave(&driver_lock, flags);
list_add(&drv->list, &drivers);