ath9k: Fix incorrect access of rate flags in RC
[pandora-kernel.git] / drivers / mfd / tc6387xb.c
index 517f9bc..6315f63 100644 (file)
@@ -137,7 +137,7 @@ static struct mfd_cell tc6387xb_cells[] = {
        },
 };
 
-static int tc6387xb_probe(struct platform_device *dev)
+static int __devinit tc6387xb_probe(struct platform_device *dev)
 {
        struct tc6387xb_platform_data *pdata = dev->dev.platform_data;
        struct resource *iomem, *rscr;
@@ -201,6 +201,7 @@ static int tc6387xb_probe(struct platform_device *dev)
        if (!ret)
                return 0;
 
+       iounmap(tc6387xb->scr);
 err_ioremap:
        release_resource(&tc6387xb->rscr);
 err_resource:
@@ -211,14 +212,17 @@ err_no_irq:
        return ret;
 }
 
-static int tc6387xb_remove(struct platform_device *dev)
+static int __devexit tc6387xb_remove(struct platform_device *dev)
 {
-       struct clk *clk32k = platform_get_drvdata(dev);
+       struct tc6387xb *tc6387xb = platform_get_drvdata(dev);
 
        mfd_remove_devices(&dev->dev);
-       clk_disable(clk32k);
-       clk_put(clk32k);
+       iounmap(tc6387xb->scr);
+       release_resource(&tc6387xb->rscr);
+       clk_disable(tc6387xb->clk32k);
+       clk_put(tc6387xb->clk32k);
        platform_set_drvdata(dev, NULL);
+       kfree(tc6387xb);
 
        return 0;
 }
@@ -229,7 +233,7 @@ static struct platform_driver tc6387xb_platform_driver = {
                .name           = "tc6387xb",
        },
        .probe          = tc6387xb_probe,
-       .remove         = tc6387xb_remove,
+       .remove         = __devexit_p(tc6387xb_remove),
        .suspend        = tc6387xb_suspend,
        .resume         = tc6387xb_resume,
 };