Merge tag 'ecryptfs-3.6-rc1-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git...
[firefly-linux-kernel-4.4.55.git] / arch / arm / mach-s3c64xx / dma.c
index 17d62f4f8204a2c551903914f5e5df4588e79fa4..f2a7a1725596787bad96e191d6e096dce2110f37 100644 (file)
@@ -16,7 +16,7 @@
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/dmapool.h>
-#include <linux/sysdev.h>
+#include <linux/device.h>
 #include <linux/errno.h>
 #include <linux/slab.h>
 #include <linux/delay.h>
@@ -35,7 +35,7 @@
 /* dma channel state information */
 
 struct s3c64xx_dmac {
-       struct sys_device        sysdev;
+       struct device           dev;
        struct clk              *clk;
        void __iomem            *regs;
        struct s3c2410_dma_chan *channels;
@@ -631,8 +631,9 @@ static irqreturn_t s3c64xx_dma_irq(int irq, void *pw)
        return IRQ_HANDLED;
 }
 
-static struct sysdev_class dma_sysclass = {
+static struct bus_type dma_subsys = {
        .name           = "s3c64xx-dma",
+       .dev_name       = "s3c64xx-dma",
 };
 
 static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
@@ -651,12 +652,12 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
                return -ENOMEM;
        }
 
-       dmac->sysdev.id = chno / 8;
-       dmac->sysdev.cls = &dma_sysclass;
+       dmac->dev.id = chno / 8;
+       dmac->dev.bus = &dma_subsys;
 
-       err = sysdev_register(&dmac->sysdev);
+       err = device_register(&dmac->dev);
        if (err) {
-               printk(KERN_ERR "%s: failed to register sysdevice\n", __func__);
+               printk(KERN_ERR "%s: failed to register device\n", __func__);
                goto err_alloc;
        }
 
@@ -667,7 +668,7 @@ static int s3c64xx_dma_init1(int chno, enum dma_ch chbase,
                goto err_dev;
        }
 
-       snprintf(clkname, sizeof(clkname), "dma%d", dmac->sysdev.id);
+       snprintf(clkname, sizeof(clkname), "dma%d", dmac->dev.id);
 
        dmac->clk = clk_get(NULL, clkname);
        if (IS_ERR(dmac->clk)) {
@@ -715,7 +716,7 @@ err_clk:
 err_map:
        iounmap(regs);
 err_dev:
-       sysdev_unregister(&dmac->sysdev);
+       device_unregister(&dmac->dev);
 err_alloc:
        kfree(dmac);
        return err;
@@ -733,9 +734,9 @@ static int __init s3c64xx_dma_init(void)
                return -ENOMEM;
        }
 
-       ret = sysdev_class_register(&dma_sysclass);
+       ret = subsys_system_register(&dma_subsys, NULL);
        if (ret) {
-               printk(KERN_ERR "%s: failed to create sysclass\n", __func__);
+               printk(KERN_ERR "%s: failed to create subsys\n", __func__);
                return -ENOMEM;
        }