]> git.karo-electronics.de Git - karo-tx-linux.git/blobdiff - drivers/spi/spi-pxa2xx.c
Merge remote-tracking branches 'spi/topic/oom', 'spi/topic/pxa2xx', 'spi/topic/rspi...
[karo-tx-linux.git] / drivers / spi / spi-pxa2xx.c
index 41185d0557fa5575531d6da9318b7c135198a681..901d0e0ba3eb5da94da95bc5d84494bf8fca507f 100644 (file)
@@ -886,11 +886,8 @@ static int setup(struct spi_device *spi)
        chip = spi_get_ctldata(spi);
        if (!chip) {
                chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL);
-               if (!chip) {
-                       dev_err(&spi->dev,
-                               "failed setup: can't allocate chip data\n");
+               if (!chip)
                        return -ENOMEM;
-               }
 
                if (drv_data->ssp_type == CE4100_SSP) {
                        if (spi->chip_select > 4) {
@@ -1037,11 +1034,8 @@ pxa2xx_spi_acpi_get_pdata(struct platform_device *pdev)
                return NULL;
 
        pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL);
-       if (!pdata) {
-               dev_err(&pdev->dev,
-                       "failed to allocate memory for platform data\n");
+       if (!pdata)
                return NULL;
-       }
 
        res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
        if (!res)
@@ -1202,6 +1196,11 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
        tasklet_init(&drv_data->pump_transfers, pump_transfers,
                     (unsigned long)drv_data);
 
+       pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
+       pm_runtime_use_autosuspend(&pdev->dev);
+       pm_runtime_set_active(&pdev->dev);
+       pm_runtime_enable(&pdev->dev);
+
        /* Register with the SPI framework */
        platform_set_drvdata(pdev, drv_data);
        status = devm_spi_register_master(&pdev->dev, master);
@@ -1210,11 +1209,6 @@ static int pxa2xx_spi_probe(struct platform_device *pdev)
                goto out_error_clock_enabled;
        }
 
-       pm_runtime_set_autosuspend_delay(&pdev->dev, 50);
-       pm_runtime_use_autosuspend(&pdev->dev);
-       pm_runtime_set_active(&pdev->dev);
-       pm_runtime_enable(&pdev->dev);
-
        return status;
 
 out_error_clock_enabled: