]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/mfd/ti_am335x_tscadc.c
mfd: ti_am335x_tscadc: print error message with dev_err() instead of dev_dbg()
[karo-tx-linux.git] / drivers / mfd / ti_am335x_tscadc.c
index d4e860413bb54e1af55409dd7c8dc29e47747b02..37cb42ca1be0719055059e08cf7d51f499ced985 100644 (file)
@@ -14,7 +14,6 @@
  */
 
 #include <linux/module.h>
-#include <linux/init.h>
 #include <linux/slab.h>
 #include <linux/err.h>
 #include <linux/io.h>
@@ -143,8 +142,8 @@ static      int ti_tscadc_probe(struct platform_device *pdev)
        struct clk              *clk;
        struct device_node      *node = pdev->dev.of_node;
        struct mfd_cell         *cell;
-       struct property         *prop;
-       const __be32            *cur;
+       struct property         *prop;
+       const __be32            *cur;
        u32                     val;
        int                     err, ctrl;
        int                     clock_rate;
@@ -184,12 +183,6 @@ static     int ti_tscadc_probe(struct platform_device *pdev)
                return -EINVAL;
        }
 
-       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
-       if (!res) {
-               dev_err(&pdev->dev, "no memory resource defined.\n");
-               return -EINVAL;
-       }
-
        /* Allocate memory for device */
        tscadc = devm_kzalloc(&pdev->dev,
                        sizeof(struct ti_tscadc_dev), GFP_KERNEL);
@@ -206,19 +199,10 @@ static    int ti_tscadc_probe(struct platform_device *pdev)
        } 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");
-               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");
-               return -ENOMEM;
-       }
+       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
+       tscadc->tscadc_base = devm_ioremap_resource(&pdev->dev, res);
+       if (IS_ERR(tscadc->tscadc_base))
+               return PTR_ERR(tscadc->tscadc_base);
 
        tscadc->regmap_tscadc = devm_regmap_init_mmio(&pdev->dev,
                        tscadc->tscadc_base, &tscadc_regmap_config);
@@ -298,8 +282,11 @@ static     int ti_tscadc_probe(struct platform_device *pdev)
 
        err = mfd_add_devices(&pdev->dev, pdev->id, tscadc->cells,
                        tscadc->used_cells, NULL, 0, NULL);
-       if (err < 0)
+       if (err < 0) {
+               dev_err(&pdev->dev, "Failed to add MFD devices\n");
                goto err_disable_clk;
+       }
+       dev_info(&pdev->dev, "TI Touchscreen/ADC driver initialized\n");
 
        device_init_wakeup(&pdev->dev, true);
        platform_set_drvdata(pdev, tscadc);