]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - sound/sparc/cs4231.c
of/device: Replace struct of_device with struct platform_device
[mirror_ubuntu-bionic-kernel.git] / sound / sparc / cs4231.c
index fb4c6f2f29e5d1b97a69ec2ccd00d6ff7b750ff4..c276086c3b5783bc32ae28ffbac8cd9c3fc9473d 100644 (file)
@@ -111,7 +111,7 @@ struct snd_cs4231 {
        struct mutex            mce_mutex;      /* mutex for mce register */
        struct mutex            open_mutex;     /* mutex for ALSA open/close */
 
-       struct of_device        *op;
+       struct platform_device  *op;
        unsigned int            irq[2];
        unsigned int            regs_size;
        struct snd_cs4231       *next;
@@ -1771,7 +1771,7 @@ static unsigned int sbus_dma_addr(struct cs4231_dma_control *dma_cont)
 
 static int snd_cs4231_sbus_free(struct snd_cs4231 *chip)
 {
-       struct of_device *op = chip->op;
+       struct platform_device *op = chip->op;
 
        if (chip->irq[0])
                free_irq(chip->irq[0], chip);
@@ -1794,7 +1794,7 @@ static struct snd_device_ops snd_cs4231_sbus_dev_ops = {
 };
 
 static int __devinit snd_cs4231_sbus_create(struct snd_card *card,
-                                           struct of_device *op,
+                                           struct platform_device *op,
                                            int dev)
 {
        struct snd_cs4231 *chip = card->private_data;
@@ -1832,14 +1832,14 @@ static int __devinit snd_cs4231_sbus_create(struct snd_card *card,
        chip->c_dma.request = sbus_dma_request;
        chip->c_dma.address = sbus_dma_addr;
 
-       if (request_irq(op->irqs[0], snd_cs4231_sbus_interrupt,
+       if (request_irq(op->archdata.irqs[0], snd_cs4231_sbus_interrupt,
                        IRQF_SHARED, "cs4231", chip)) {
                snd_printdd("cs4231-%d: Unable to grab SBUS IRQ %d\n",
-                           dev, op->irqs[0]);
+                           dev, op->archdata.irqs[0]);
                snd_cs4231_sbus_free(chip);
                return -EBUSY;
        }
-       chip->irq[0] = op->irqs[0];
+       chip->irq[0] = op->archdata.irqs[0];
 
        if (snd_cs4231_probe(chip) < 0) {
                snd_cs4231_sbus_free(chip);
@@ -1856,7 +1856,7 @@ static int __devinit snd_cs4231_sbus_create(struct snd_card *card,
        return 0;
 }
 
-static int __devinit cs4231_sbus_probe(struct of_device *op, const struct of_device_id *match)
+static int __devinit cs4231_sbus_probe(struct platform_device *op, const struct of_device_id *match)
 {
        struct resource *rp = &op->resource[0];
        struct snd_card *card;
@@ -1870,7 +1870,7 @@ static int __devinit cs4231_sbus_probe(struct of_device *op, const struct of_dev
                card->shortname,
                rp->flags & 0xffL,
                (unsigned long long)rp->start,
-               op->irqs[0]);
+               op->archdata.irqs[0]);
 
        err = snd_cs4231_sbus_create(card, op, dev);
        if (err < 0) {
@@ -1931,7 +1931,7 @@ static unsigned int _ebus_dma_addr(struct cs4231_dma_control *dma_cont)
 
 static int snd_cs4231_ebus_free(struct snd_cs4231 *chip)
 {
-       struct of_device *op = chip->op;
+       struct platform_device *op = chip->op;
 
        if (chip->c_dma.ebus_info.regs) {
                ebus_dma_unregister(&chip->c_dma.ebus_info);
@@ -1960,7 +1960,7 @@ static struct snd_device_ops snd_cs4231_ebus_dev_ops = {
 };
 
 static int __devinit snd_cs4231_ebus_create(struct snd_card *card,
-                                           struct of_device *op,
+                                           struct platform_device *op,
                                            int dev)
 {
        struct snd_cs4231 *chip = card->private_data;
@@ -1979,12 +1979,12 @@ static int __devinit snd_cs4231_ebus_create(struct snd_card *card,
        chip->c_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER;
        chip->c_dma.ebus_info.callback = snd_cs4231_ebus_capture_callback;
        chip->c_dma.ebus_info.client_cookie = chip;
-       chip->c_dma.ebus_info.irq = op->irqs[0];
+       chip->c_dma.ebus_info.irq = op->archdata.irqs[0];
        strcpy(chip->p_dma.ebus_info.name, "cs4231(play)");
        chip->p_dma.ebus_info.flags = EBUS_DMA_FLAG_USE_EBDMA_HANDLER;
        chip->p_dma.ebus_info.callback = snd_cs4231_ebus_play_callback;
        chip->p_dma.ebus_info.client_cookie = chip;
-       chip->p_dma.ebus_info.irq = op->irqs[1];
+       chip->p_dma.ebus_info.irq = op->archdata.irqs[1];
 
        chip->p_dma.prepare = _ebus_dma_prepare;
        chip->p_dma.enable = _ebus_dma_enable;
@@ -2048,7 +2048,7 @@ static int __devinit snd_cs4231_ebus_create(struct snd_card *card,
        return 0;
 }
 
-static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_device_id *match)
+static int __devinit cs4231_ebus_probe(struct platform_device *op, const struct of_device_id *match)
 {
        struct snd_card *card;
        int err;
@@ -2060,7 +2060,7 @@ static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_dev
        sprintf(card->longname, "%s at 0x%llx, irq %d",
                card->shortname,
                op->resource[0].start,
-               op->irqs[0]);
+               op->archdata.irqs[0]);
 
        err = snd_cs4231_ebus_create(card, op, dev);
        if (err < 0) {
@@ -2072,7 +2072,7 @@ static int __devinit cs4231_ebus_probe(struct of_device *op, const struct of_dev
 }
 #endif
 
-static int __devinit cs4231_probe(struct of_device *op, const struct of_device_id *match)
+static int __devinit cs4231_probe(struct platform_device *op, const struct of_device_id *match)
 {
 #ifdef EBUS_SUPPORT
        if (!strcmp(op->dev.of_node->parent->name, "ebus"))
@@ -2086,7 +2086,7 @@ static int __devinit cs4231_probe(struct of_device *op, const struct of_device_i
        return -ENODEV;
 }
 
-static int __devexit cs4231_remove(struct of_device *op)
+static int __devexit cs4231_remove(struct platform_device *op)
 {
        struct snd_cs4231 *chip = dev_get_drvdata(&op->dev);
 
@@ -2120,12 +2120,12 @@ static struct of_platform_driver cs4231_driver = {
 
 static int __init cs4231_init(void)
 {
-       return of_register_driver(&cs4231_driver, &of_bus_type);
+       return of_register_platform_driver(&cs4231_driver);
 }
 
 static void __exit cs4231_exit(void)
 {
-       of_unregister_driver(&cs4231_driver);
+       of_unregister_platform_driver(&cs4231_driver);
 }
 
 module_init(cs4231_init);