diff options
author | Kay Sievers <kay.sievers@vrfy.org> | 2008-02-08 18:00:49 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2008-02-08 18:33:33 -0500 |
commit | 765cdb6cef63c0b41c3f6c9285769080b3f41bb0 (patch) | |
tree | 0a66a606936d51249b3b4545bbbe426c4e1be0c7 /drivers/dca | |
parent | 11b0cc3a4af65413ca3bb5698769e091486e0b22 (diff) |
DCA: convert struct class_device to struct device.
Thanks to Kay for keeping us honest.
Signed-off-by: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Shannon Nelson <shannon.nelson@intel.com>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>
Acked-by: Greg KH <greg@kroah.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/dca')
-rw-r--r-- | drivers/dca/dca-sysfs.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/dca/dca-sysfs.c b/drivers/dca/dca-sysfs.c index 24a263b6844c..011328faa5f2 100644 --- a/drivers/dca/dca-sysfs.c +++ b/drivers/dca/dca-sysfs.c | |||
@@ -12,10 +12,10 @@ static spinlock_t dca_idr_lock; | |||
12 | 12 | ||
13 | int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) | 13 | int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) |
14 | { | 14 | { |
15 | struct class_device *cd; | 15 | struct device *cd; |
16 | 16 | ||
17 | cd = class_device_create(dca_class, dca->cd, MKDEV(0, slot + 1), | 17 | cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1), |
18 | dev, "requester%d", slot); | 18 | "requester%d", slot); |
19 | if (IS_ERR(cd)) | 19 | if (IS_ERR(cd)) |
20 | return PTR_ERR(cd); | 20 | return PTR_ERR(cd); |
21 | return 0; | 21 | return 0; |
@@ -23,12 +23,12 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) | |||
23 | 23 | ||
24 | void dca_sysfs_remove_req(struct dca_provider *dca, int slot) | 24 | void dca_sysfs_remove_req(struct dca_provider *dca, int slot) |
25 | { | 25 | { |
26 | class_device_destroy(dca_class, MKDEV(0, slot + 1)); | 26 | device_destroy(dca_class, MKDEV(0, slot + 1)); |
27 | } | 27 | } |
28 | 28 | ||
29 | int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev) | 29 | int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev) |
30 | { | 30 | { |
31 | struct class_device *cd; | 31 | struct device *cd; |
32 | int err = 0; | 32 | int err = 0; |
33 | 33 | ||
34 | idr_try_again: | 34 | idr_try_again: |
@@ -46,8 +46,7 @@ idr_try_again: | |||
46 | return err; | 46 | return err; |
47 | } | 47 | } |
48 | 48 | ||
49 | cd = class_device_create(dca_class, NULL, MKDEV(0, 0), | 49 | cd = device_create(dca_class, dev, MKDEV(0, 0), "dca%d", dca->id); |
50 | dev, "dca%d", dca->id); | ||
51 | if (IS_ERR(cd)) { | 50 | if (IS_ERR(cd)) { |
52 | spin_lock(&dca_idr_lock); | 51 | spin_lock(&dca_idr_lock); |
53 | idr_remove(&dca_idr, dca->id); | 52 | idr_remove(&dca_idr, dca->id); |
@@ -60,7 +59,7 @@ idr_try_again: | |||
60 | 59 | ||
61 | void dca_sysfs_remove_provider(struct dca_provider *dca) | 60 | void dca_sysfs_remove_provider(struct dca_provider *dca) |
62 | { | 61 | { |
63 | class_device_unregister(dca->cd); | 62 | device_unregister(dca->cd); |
64 | dca->cd = NULL; | 63 | dca->cd = NULL; |
65 | spin_lock(&dca_idr_lock); | 64 | spin_lock(&dca_idr_lock); |
66 | idr_remove(&dca_idr, dca->id); | 65 | idr_remove(&dca_idr, dca->id); |