spi-pxa2xx.c (e4745fef5595df7405ea24d6b21ba0e65332bb8e) | spi-pxa2xx.c (9deae4592b66c0b2a7832fefa192e7a506ce047e) |
---|---|
1/* 2 * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs 3 * Copyright (C) 2013, Intel Corporation 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 13 unchanged lines hidden (view full) --- 22#include <linux/device.h> 23#include <linux/ioport.h> 24#include <linux/errno.h> 25#include <linux/err.h> 26#include <linux/interrupt.h> 27#include <linux/platform_device.h> 28#include <linux/spi/pxa2xx_spi.h> 29#include <linux/spi/spi.h> | 1/* 2 * Copyright (C) 2005 Stephen Street / StreetFire Sound Labs 3 * Copyright (C) 2013, Intel Corporation 4 * 5 * This program is free software; you can redistribute it and/or modify 6 * it under the terms of the GNU General Public License as published by 7 * the Free Software Foundation; either version 2 of the License, or 8 * (at your option) any later version. --- 13 unchanged lines hidden (view full) --- 22#include <linux/device.h> 23#include <linux/ioport.h> 24#include <linux/errno.h> 25#include <linux/err.h> 26#include <linux/interrupt.h> 27#include <linux/platform_device.h> 28#include <linux/spi/pxa2xx_spi.h> 29#include <linux/spi/spi.h> |
30#include <linux/workqueue.h> |
|
30#include <linux/delay.h> 31#include <linux/gpio.h> 32#include <linux/slab.h> 33#include <linux/clk.h> 34#include <linux/pm_runtime.h> 35#include <linux/acpi.h> 36 37#include <asm/io.h> --- 842 unchanged lines hidden (view full) --- 880 tx_hi_thres = 0; 881 rx_thres = RX_THRESH_DFLT; 882 } 883 884 /* Only alloc on first setup */ 885 chip = spi_get_ctldata(spi); 886 if (!chip) { 887 chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); | 31#include <linux/delay.h> 32#include <linux/gpio.h> 33#include <linux/slab.h> 34#include <linux/clk.h> 35#include <linux/pm_runtime.h> 36#include <linux/acpi.h> 37 38#include <asm/io.h> --- 842 unchanged lines hidden (view full) --- 881 tx_hi_thres = 0; 882 rx_thres = RX_THRESH_DFLT; 883 } 884 885 /* Only alloc on first setup */ 886 chip = spi_get_ctldata(spi); 887 if (!chip) { 888 chip = kzalloc(sizeof(struct chip_data), GFP_KERNEL); |
888 if (!chip) { 889 dev_err(&spi->dev, 890 "failed setup: can't allocate chip data\n"); | 889 if (!chip) |
891 return -ENOMEM; | 890 return -ENOMEM; |
892 } | |
893 894 if (drv_data->ssp_type == CE4100_SSP) { 895 if (spi->chip_select > 4) { 896 dev_err(&spi->dev, 897 "failed setup: cs number must not be > 4.\n"); 898 kfree(chip); 899 return -EINVAL; 900 } --- 130 unchanged lines hidden (view full) --- 1031 struct resource *res; 1032 int devid; 1033 1034 if (!ACPI_HANDLE(&pdev->dev) || 1035 acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev)) 1036 return NULL; 1037 1038 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); | 891 892 if (drv_data->ssp_type == CE4100_SSP) { 893 if (spi->chip_select > 4) { 894 dev_err(&spi->dev, 895 "failed setup: cs number must not be > 4.\n"); 896 kfree(chip); 897 return -EINVAL; 898 } --- 130 unchanged lines hidden (view full) --- 1029 struct resource *res; 1030 int devid; 1031 1032 if (!ACPI_HANDLE(&pdev->dev) || 1033 acpi_bus_get_device(ACPI_HANDLE(&pdev->dev), &adev)) 1034 return NULL; 1035 1036 pdata = devm_kzalloc(&pdev->dev, sizeof(*pdata), GFP_KERNEL); |
1039 if (!pdata) { 1040 dev_err(&pdev->dev, 1041 "failed to allocate memory for platform data\n"); | 1037 if (!pdata) |
1042 return NULL; | 1038 return NULL; |
1043 } | |
1044 1045 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1046 if (!res) 1047 return NULL; 1048 1049 ssp = &pdata->ssp; 1050 1051 ssp->phys_base = res->start; --- 305 unchanged lines hidden --- | 1039 1040 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 1041 if (!res) 1042 return NULL; 1043 1044 ssp = &pdata->ssp; 1045 1046 ssp->phys_base = res->start; --- 305 unchanged lines hidden --- |