]> www.pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/dca/dca-sysfs.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/djbw/async_tx
[linux-2.6-omap-h63xx.git] / drivers / dca / dca-sysfs.c
index 24a263b6844cc5c76213e17856a4d9b74d6e0eda..7af4b403bd2d12a6f3219f8f8d6615f5de69def1 100644 (file)
@@ -12,10 +12,12 @@ static spinlock_t dca_idr_lock;
 
 int dca_sysfs_add_req(struct dca_provider *dca, struct device *dev, int slot)
 {
-       struct class_device *cd;
+       struct device *cd;
+       static int req_count;
 
-       cd = class_device_create(dca_class, dca->cd, MKDEV(0, slot + 1),
-                                dev, "requester%d", slot);
+       cd = device_create_drvdata(dca_class, dca->cd,
+                                  MKDEV(0, slot + 1), NULL,
+                                  "requester%d", req_count++);
        if (IS_ERR(cd))
                return PTR_ERR(cd);
        return 0;
@@ -23,12 +25,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)
 {
-       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)
 {
-       struct class_device *cd;
+       struct device *cd;
        int err = 0;
 
 idr_try_again:
@@ -46,8 +48,8 @@ idr_try_again:
                return err;
        }
 
-       cd = class_device_create(dca_class, NULL, MKDEV(0, 0),
-                                dev, "dca%d", dca->id);
+       cd = device_create_drvdata(dca_class, dev, MKDEV(0, 0), NULL,
+                                  "dca%d", dca->id);
        if (IS_ERR(cd)) {
                spin_lock(&dca_idr_lock);
                idr_remove(&dca_idr, dca->id);
@@ -60,7 +62,7 @@ idr_try_again:
 
 void dca_sysfs_remove_provider(struct dca_provider *dca)
 {
-       class_device_unregister(dca->cd);
+       device_unregister(dca->cd);
        dca->cd = NULL;
        spin_lock(&dca_idr_lock);
        idr_remove(&dca_idr, dca->id);