aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/isdn/gigaset/proc.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/isdn/gigaset/proc.c')
-rw-r--r--drivers/isdn/gigaset/proc.c21
1 files changed, 13 insertions, 8 deletions
diff --git a/drivers/isdn/gigaset/proc.c b/drivers/isdn/gigaset/proc.c
index d267a636b53c..9ae3a7f3e7b3 100644
--- a/drivers/isdn/gigaset/proc.c
+++ b/drivers/isdn/gigaset/proc.c
@@ -16,12 +16,11 @@
16#include "gigaset.h" 16#include "gigaset.h"
17#include <linux/ctype.h> 17#include <linux/ctype.h>
18 18
19static ssize_t show_cidmode(struct device *dev, struct device_attribute *attr, 19static ssize_t show_cidmode(struct class_device *class, char *buf)
20 char *buf)
21{ 20{
22 int ret; 21 int ret;
23 unsigned long flags; 22 unsigned long flags;
24 struct cardstate *cs = dev_get_drvdata(dev); 23 struct cardstate *cs = class_get_devdata(class);
25 24
26 spin_lock_irqsave(&cs->lock, flags); 25 spin_lock_irqsave(&cs->lock, flags);
27 ret = sprintf(buf, "%u\n", cs->cidmode); 26 ret = sprintf(buf, "%u\n", cs->cidmode);
@@ -30,10 +29,10 @@ static ssize_t show_cidmode(struct device *dev, struct device_attribute *attr,
30 return ret; 29 return ret;
31} 30}
32 31
33static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr, 32static ssize_t set_cidmode(struct class_device *class,
34 const char *buf, size_t count) 33 const char *buf, size_t count)
35{ 34{
36 struct cardstate *cs = dev_get_drvdata(dev); 35 struct cardstate *cs = class_get_devdata(class);
37 long int value; 36 long int value;
38 char *end; 37 char *end;
39 38
@@ -65,18 +64,24 @@ static ssize_t set_cidmode(struct device *dev, struct device_attribute *attr,
65 return count; 64 return count;
66} 65}
67 66
68static DEVICE_ATTR(cidmode, S_IRUGO|S_IWUSR, show_cidmode, set_cidmode); 67static CLASS_DEVICE_ATTR(cidmode, S_IRUGO|S_IWUSR, show_cidmode, set_cidmode);
69 68
70/* free sysfs for device */ 69/* free sysfs for device */
71void gigaset_free_dev_sysfs(struct cardstate *cs) 70void gigaset_free_dev_sysfs(struct cardstate *cs)
72{ 71{
72 if (!cs->class)
73 return;
74
73 gig_dbg(DEBUG_INIT, "removing sysfs entries"); 75 gig_dbg(DEBUG_INIT, "removing sysfs entries");
74 device_remove_file(cs->dev, &dev_attr_cidmode); 76 class_device_remove_file(cs->class, &class_device_attr_cidmode);
75} 77}
76 78
77/* initialize sysfs for device */ 79/* initialize sysfs for device */
78void gigaset_init_dev_sysfs(struct cardstate *cs) 80void gigaset_init_dev_sysfs(struct cardstate *cs)
79{ 81{
82 if (!cs->class)
83 return;
84
80 gig_dbg(DEBUG_INIT, "setting up sysfs"); 85 gig_dbg(DEBUG_INIT, "setting up sysfs");
81 device_create_file(cs->dev, &dev_attr_cidmode); 86 class_device_create_file(cs->class, &class_device_attr_cidmode);
82} 87}