Skip to content

Commit 765cdb6

Browse files
kaysieversLinus Torvalds
authored andcommitted
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>
1 parent 11b0cc3 commit 765cdb6

2 files changed

Lines changed: 8 additions & 9 deletions

File tree

‎drivers/dca/dca-sysfs.c‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@ static spinlock_t dca_idr_lock;
1212

1313
int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
1414
{
15-
struct class_device *cd;
15+
struct device *cd;
1616

17-
cd = class_device_create(dca_class, dca->cd, MKDEV(0, slot + 1),
18-
dev, "requester%d", slot);
17+
cd = device_create(dca_class, dca->cd, MKDEV(0, slot + 1),
18+
"requester%d", slot);
1919
if (IS_ERR(cd))
2020
return PTR_ERR(cd);
2121
return 0;
2222
}
2323

2424
void dca_sysfs_remove_req(struct dca_provider *dca, int slot)
2525
{
26-
class_device_destroy(dca_class, MKDEV(0, slot + 1));
26+
device_destroy(dca_class, MKDEV(0, slot + 1));
2727
}
2828

2929
int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev)
3030
{
31-
struct class_device *cd;
31+
struct device *cd;
3232
int err = 0;
3333

3434
idr_try_again:
@@ -46,8 +46,7 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev)
4646
return err;
4747
}
4848

49-
cd = class_device_create(dca_class, NULL, MKDEV(0, 0),
50-
dev, "dca%d", dca->id);
49+
cd = device_create(dca_class, dev, MKDEV(0, 0), "dca%d", dca->id);
5150
if (IS_ERR(cd)) {
5251
spin_lock(&dca_idr_lock);
5352
idr_remove(&dca_idr, dca->id);
@@ -60,7 +59,7 @@ int dca_sysfs_add_provider(struct dca_provider *dca, struct device *dev)
6059

6160
void dca_sysfs_remove_provider(struct dca_provider *dca)
6261
{
63-
class_device_unregister(dca->cd);
62+
device_unregister(dca->cd);
6463
dca->cd = NULL;
6564
spin_lock(&dca_idr_lock);
6665
idr_remove(&dca_idr, dca->id);

‎include/linux/dca.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ void dca_unregister_notify(struct notifier_block *nb);
1111

1212
struct dca_provider {
1313
struct dca_ops *ops;
14-
struct class_device *cd;
14+
struct device *cd;
1515
int id;
1616
};
1717

0 commit comments

Comments
 (0)