Commit 765cdb6c authored by Kay Sievers's avatar Kay Sievers Committed by Linus Torvalds

DCA: convert struct class_device to struct device.

Thanks to Kay for keeping us honest.
Signed-off-by: default avatarKay Sievers <kay.sievers@vrfy.org>
Signed-off-by: default avatarShannon Nelson <shannon.nelson@intel.com>
Cc: "Williams, Dan J" <dan.j.williams@intel.com>
Acked-by: default avatarGreg KH <greg@kroah.com>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 11b0cc3a
...@@ -12,10 +12,10 @@ static spinlock_t dca_idr_lock; ...@@ -12,10 +12,10 @@ static spinlock_t dca_idr_lock;
int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
{ {
struct class_device *cd; struct device *cd;
cd = class_device_create(dca_class, dca->cd, MKDEV(0, slot + 1), cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1),
dev, "requester%d", slot); "requester%d", slot);
if (IS_ERR(cd)) if (IS_ERR(cd))
return PTR_ERR(cd); return PTR_ERR(cd);
return 0; return 0;
...@@ -23,12 +23,12 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot) ...@@ -23,12 +23,12 @@ int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
void dca_sysfs_remove_req(struct dca_provider *dca, int slot) void dca_sysfs_remove_req(struct dca_provider *dca, int slot)
{ {
class_device_destroy(dca_class, MKDEV(0, slot + 1)); device_destroy(dca_class, MKDEV(0, slot + 1));
} }
int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev) int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev)
{ {
struct class_device *cd; struct device *cd;
int err = 0; int err = 0;
idr_try_again: idr_try_again:
...@@ -46,8 +46,7 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev) ...@@ -46,8 +46,7 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev)
return err; return err;
} }
cd = class_device_create(dca_class, NULL, MKDEV(0, 0), cd = device_create(dca_class, dev, MKDEV(0, 0), "dca%d", dca->id);
dev, "dca%d", dca->id);
if (IS_ERR(cd)) { if (IS_ERR(cd)) {
spin_lock(&dca_idr_lock); spin_lock(&dca_idr_lock);
idr_remove(&dca_idr, dca->id); idr_remove(&dca_idr, dca->id);
...@@ -60,7 +59,7 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev) ...@@ -60,7 +59,7 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev)
void dca_sysfs_remove_provider(struct dca_provider *dca) void dca_sysfs_remove_provider(struct dca_provider *dca)
{ {
class_device_unregister(dca->cd); device_unregister(dca->cd);
dca->cd = NULL; dca->cd = NULL;
spin_lock(&dca_idr_lock); spin_lock(&dca_idr_lock);
idr_remove(&dca_idr, dca->id); idr_remove(&dca_idr, dca->id);
......
...@@ -11,7 +11,7 @@ void dca_unregister_notify(struct notifier_block *nb); ...@@ -11,7 +11,7 @@ void dca_unregister_notify(struct notifier_block *nb);
struct dca_provider { struct dca_provider {
struct dca_ops *ops; struct dca_ops *ops;
struct class_device *cd; struct device *cd;
int id; int id;
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment