diff options
author | Hansjoerg Lipp <hjlipp@web.de> | 2006-04-22 18:43:00 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2006-06-21 12:40:47 -0700 |
commit | 3dda4e373c7474cfe280f4270b70c1563f92a2a7 (patch) | |
tree | b38e2c22056859de773ef8e47b059f53a52d0215 /drivers/isdn/gigaset/interface.c | |
parent | 1cdcb6b43fda7424b7435dac8f80b2b5d8a48899 (diff) |
[PATCH] i4l gigaset: move sysfs entry to tty class device
Using the class device pointer returned by tty_register_device() with
part 1 of the patch, attach the Gigaset drivers' "cidmode" sysfs entry
to its tty class device, where it can be found more easily by users
who do not know nor care which USB port the device is attached to.
Signed-off-by: Hansjoerg Lipp <hjlipp@web.de>
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/isdn/gigaset/interface.c')
-rw-r--r-- | drivers/isdn/gigaset/interface.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/isdn/gigaset/interface.c b/drivers/isdn/gigaset/interface.c index 08e4c4eea14..74fd234956c 100644 --- a/drivers/isdn/gigaset/interface.c +++ b/drivers/isdn/gigaset/interface.c @@ -625,7 +625,14 @@ void gigaset_if_init(struct cardstate *cs) return; tasklet_init(&cs->if_wake_tasklet, &if_wake, (unsigned long) cs); - tty_register_device(drv->tty, cs->minor_index, NULL); + cs->class = tty_register_device(drv->tty, cs->minor_index, NULL); + + if (!IS_ERR(cs->class)) + class_set_devdata(cs->class, cs); + else { + warn("could not register device to the tty subsystem"); + cs->class = NULL; + } } void gigaset_if_free(struct cardstate *cs) @@ -638,6 +645,7 @@ void gigaset_if_free(struct cardstate *cs) tasklet_disable(&cs->if_wake_tasklet); tasklet_kill(&cs->if_wake_tasklet); + cs->class = NULL; tty_unregister_device(drv->tty, cs->minor_index); } |