diff options
author | Tilman Schmidt <tilman@imap.cc> | 2006-04-11 01:55:07 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-04-11 09:18:49 -0400 |
commit | b1d47464c947f08125dc4ac4a2321ced9e2fed29 (patch) | |
tree | 6a977f4335c5a2ab734779fb52565c81eb61bb1b /drivers/isdn/gigaset/proc.c | |
parent | 784d5858aac58c06608def862d73ae9a32f5ee23 (diff) |
[PATCH] isdn4linux: Siemens Gigaset drivers: sysfs usage
With Hansjoerg Lipp <hjlipp@web.de>
Correct the way the Gigaset drivers create their sysfs entries.
Signed-off-by: Hansjoerg Lipp <hjlipp@web.de>
Signed-off-by: Tilman Schmidt <tilman@imap.cc>
Cc: Karsten Keil <kkeil@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'drivers/isdn/gigaset/proc.c')
-rw-r--r-- | drivers/isdn/gigaset/proc.c | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/isdn/gigaset/proc.c b/drivers/isdn/gigaset/proc.c index 695495ad0668..912fed670742 100644 --- a/drivers/isdn/gigaset/proc.c +++ b/drivers/isdn/gigaset/proc.c | |||
@@ -19,16 +19,14 @@ | |||
19 | static ssize_t show_cidmode(struct device *dev, struct device_attribute *attr, | 19 | static ssize_t show_cidmode(struct device *dev, struct device_attribute *attr, |
20 | char *buf) | 20 | char *buf) |
21 | { | 21 | { |
22 | struct usb_interface *intf = to_usb_interface(dev); | 22 | struct cardstate *cs = dev_get_drvdata(dev); |
23 | struct cardstate *cs = usb_get_intfdata(intf); | ||
24 | return sprintf(buf, "%d\n", atomic_read(&cs->cidmode)); | 23 | return sprintf(buf, "%d\n", atomic_read(&cs->cidmode)); |
25 | } | 24 | } |
26 | 25 | ||
27 | static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, | 26 | static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, |
28 | const char *buf, size_t count) | 27 | const char *buf, size_t count) |
29 | { | 28 | { |
30 | struct usb_interface *intf = to_usb_interface(dev); | 29 | struct cardstate *cs = dev_get_drvdata(dev); |
31 | struct cardstate *cs = usb_get_intfdata(intf); | ||
32 | long int value; | 30 | long int value; |
33 | char *end; | 31 | char *end; |
34 | 32 | ||
@@ -63,17 +61,15 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, | |||
63 | static DEVICE_ATTR(cidmode, S_IRUGO|S_IWUSR, show_cidmode, set_cidmode); | 61 | static DEVICE_ATTR(cidmode, S_IRUGO|S_IWUSR, show_cidmode, set_cidmode); |
64 | 62 | ||
65 | /* free sysfs for device */ | 63 | /* free sysfs for device */ |
66 | void gigaset_free_dev_sysfs(struct usb_interface *interface) | 64 | void gigaset_free_dev_sysfs(struct cardstate *cs) |
67 | { | 65 | { |
68 | gig_dbg(DEBUG_INIT, "removing sysfs entries"); | 66 | gig_dbg(DEBUG_INIT, "removing sysfs entries"); |
69 | device_remove_file(&interface->dev, &dev_attr_cidmode); | 67 | device_remove_file(cs->dev, &dev_attr_cidmode); |
70 | } | 68 | } |
71 | EXPORT_SYMBOL_GPL(gigaset_free_dev_sysfs); | ||
72 | 69 | ||
73 | /* initialize sysfs for device */ | 70 | /* initialize sysfs for device */ |
74 | void gigaset_init_dev_sysfs(struct usb_interface *interface) | 71 | void gigaset_init_dev_sysfs(struct cardstate *cs) |
75 | { | 72 | { |
76 | gig_dbg(DEBUG_INIT, "setting up sysfs"); | 73 | gig_dbg(DEBUG_INIT, "setting up sysfs"); |
77 | device_create_file(&interface->dev, &dev_attr_cidmode); | 74 | device_create_file(cs->dev, &dev_attr_cidmode); |
78 | } | 75 | } |
79 | EXPORT_SYMBOL_GPL(gigaset_init_dev_sysfs); | ||