]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mfd/ti_am335x_tscadc.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
[karo-tx-linux.git] / drivers / mfd / ti_am335x_tscadc.c
index e947dd8bbcc30edcefad5b7cf9b118c8b7627699..e9f3fb510b44f965795bc87f56c26bffeefe2078 100644 (file)
@@ -58,14 +58,13 @@ static void tscadc_idle_config(struct ti_tscadc_dev *config)
        tscadc_writel(config, REG_IDLECONFIG, idleconfig);
 }
 
-static int __devinit ti_tscadc_probe(struct platform_device *pdev)
+static int ti_tscadc_probe(struct platform_device *pdev)
 {
        struct ti_tscadc_dev    *tscadc;
        struct resource         *res;
        struct clk              *clk;
        struct mfd_tscadc_board *pdata = pdev->dev.platform_data;
        struct mfd_cell         *cell;
-       int                     irq;
        int                     err, ctrl;
        int                     clk_value, clock_rate;
        int                     tsc_wires, adc_channels = 0, total_channels;
@@ -92,12 +91,6 @@ static       int __devinit ti_tscadc_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       irq = platform_get_irq(pdev, 0);
-       if (irq < 0) {
-               dev_err(&pdev->dev, "no irq ID is specified.\n");
-               return -EINVAL;
-       }
-
        /* Allocate memory for device */
        tscadc = devm_kzalloc(&pdev->dev,
                        sizeof(struct ti_tscadc_dev), GFP_KERNEL);
@@ -106,22 +99,26 @@ static     int __devinit ti_tscadc_probe(struct platform_device *pdev)
                return -ENOMEM;
        }
        tscadc->dev = &pdev->dev;
-       tscadc->irq = irq;
+
+       err = platform_get_irq(pdev, 0);
+       if (err < 0) {
+               dev_err(&pdev->dev, "no irq ID is specified.\n");
+               goto ret;
+       } else
+               tscadc->irq = err;
 
        res = devm_request_mem_region(&pdev->dev,
                        res->start, resource_size(res), pdev->name);
        if (!res) {
                dev_err(&pdev->dev, "failed to reserve registers.\n");
-               err = -EBUSY;
-               goto err;
+               return -EBUSY;
        }
 
        tscadc->tscadc_base = devm_ioremap(&pdev->dev,
                        res->start, resource_size(res));
        if (!tscadc->tscadc_base) {
                dev_err(&pdev->dev, "failed to map registers.\n");
-               err = -ENOMEM;
-               goto err;
+               return -ENOMEM;
        }
 
        tscadc->regmap_tscadc = devm_regmap_init_mmio(&pdev->dev,
@@ -129,7 +126,7 @@ static      int __devinit ti_tscadc_probe(struct platform_device *pdev)
        if (IS_ERR(tscadc->regmap_tscadc)) {
                dev_err(&pdev->dev, "regmap init failed\n");
                err = PTR_ERR(tscadc->regmap_tscadc);
-               goto err;
+               goto ret;
        }
 
        pm_runtime_enable(&pdev->dev);
@@ -201,11 +198,11 @@ static    int __devinit ti_tscadc_probe(struct platform_device *pdev)
 err_disable_clk:
        pm_runtime_put_sync(&pdev->dev);
        pm_runtime_disable(&pdev->dev);
-err:
+ret:
        return err;
 }
 
-static int __devexit ti_tscadc_remove(struct platform_device *pdev)
+static int ti_tscadc_remove(struct platform_device *pdev)
 {
        struct ti_tscadc_dev    *tscadc = platform_get_drvdata(pdev);
 
@@ -266,7 +263,7 @@ static struct platform_driver ti_tscadc_driver = {
                .pm     = TSCADC_PM_OPS,
        },
        .probe  = ti_tscadc_probe,
-       .remove = __devexit_p(ti_tscadc_remove),
+       .remove = ti_tscadc_remove,
 
 };