aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>2015-10-14 16:12:24 -0400
committerMark Brown <broonie@kernel.org>2015-10-19 15:32:01 -0400
commit1c2df965387f9a5a657a644bab5a1b5b535365b2 (patch)
treefb2d1c3b3d8173453e453805f49b50a82b258598
parent1cc3f141f0cb5a822cdef30fb1d92ae6f4176bfa (diff)
spi: dw-pci: remove unused pdev member from struct dw_spi_pci
The pdev member is not used anywhere, thus remove it. Moreover struct dw_spi_pci becomes an equivalent of struct dw_spi and therefore remove entire struct dw_spi_pci. Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r--drivers/spi/spi-dw-pci.c29
1 files changed, 9 insertions, 20 deletions
diff --git a/drivers/spi/spi-dw-pci.c b/drivers/spi/spi-dw-pci.c
index 6d331e0db331..332ccb0539a7 100644
--- a/drivers/spi/spi-dw-pci.c
+++ b/drivers/spi/spi-dw-pci.c
@@ -23,11 +23,6 @@
23 23
24#define DRIVER_NAME "dw_spi_pci" 24#define DRIVER_NAME "dw_spi_pci"
25 25
26struct dw_spi_pci {
27 struct pci_dev *pdev;
28 struct dw_spi dws;
29};
30
31struct spi_pci_desc { 26struct spi_pci_desc {
32 int (*setup)(struct dw_spi *); 27 int (*setup)(struct dw_spi *);
33 u16 num_cs; 28 u16 num_cs;
@@ -48,7 +43,6 @@ static struct spi_pci_desc spi_pci_mid_desc_2 = {
48 43
49static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) 44static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
50{ 45{
51 struct dw_spi_pci *dwpci;
52 struct dw_spi *dws; 46 struct dw_spi *dws;
53 struct spi_pci_desc *desc = (struct spi_pci_desc *)ent->driver_data; 47 struct spi_pci_desc *desc = (struct spi_pci_desc *)ent->driver_data;
54 int pci_bar = 0; 48 int pci_bar = 0;
@@ -58,14 +52,10 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
58 if (ret) 52 if (ret)
59 return ret; 53 return ret;
60 54
61 dwpci = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_pci), 55 dws = devm_kzalloc(&pdev->dev, sizeof(*dws), GFP_KERNEL);
62 GFP_KERNEL); 56 if (!dws)
63 if (!dwpci)
64 return -ENOMEM; 57 return -ENOMEM;
65 58
66 dwpci->pdev = pdev;
67 dws = &dwpci->dws;
68
69 /* Get basic io resource and map it */ 59 /* Get basic io resource and map it */
70 dws->paddr = pci_resource_start(pdev, pci_bar); 60 dws->paddr = pci_resource_start(pdev, pci_bar);
71 61
@@ -74,7 +64,6 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
74 return ret; 64 return ret;
75 65
76 dws->regs = pcim_iomap_table(pdev)[pci_bar]; 66 dws->regs = pcim_iomap_table(pdev)[pci_bar];
77
78 dws->irq = pdev->irq; 67 dws->irq = pdev->irq;
79 68
80 /* 69 /*
@@ -99,7 +88,7 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
99 return ret; 88 return ret;
100 89
101 /* PCI hook and SPI hook use the same drv data */ 90 /* PCI hook and SPI hook use the same drv data */
102 pci_set_drvdata(pdev, dwpci); 91 pci_set_drvdata(pdev, dws);
103 92
104 dev_info(&pdev->dev, "found PCI SPI controller(ID: %04x:%04x)\n", 93 dev_info(&pdev->dev, "found PCI SPI controller(ID: %04x:%04x)\n",
105 pdev->vendor, pdev->device); 94 pdev->vendor, pdev->device);
@@ -109,26 +98,26 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
109 98
110static void spi_pci_remove(struct pci_dev *pdev) 99static void spi_pci_remove(struct pci_dev *pdev)
111{ 100{
112 struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); 101 struct dw_spi *dws = pci_get_drvdata(pdev);
113 102
114 dw_spi_remove_host(&dwpci->dws); 103 dw_spi_remove_host(dws);
115} 104}
116 105
117#ifdef CONFIG_PM_SLEEP 106#ifdef CONFIG_PM_SLEEP
118static int spi_suspend(struct device *dev) 107static int spi_suspend(struct device *dev)
119{ 108{
120 struct pci_dev *pdev = to_pci_dev(dev); 109 struct pci_dev *pdev = to_pci_dev(dev);
121 struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); 110 struct dw_spi *dws = pci_get_drvdata(pdev);
122 111
123 return dw_spi_suspend_host(&dwpci->dws); 112 return dw_spi_suspend_host(dws);
124} 113}
125 114
126static int spi_resume(struct device *dev) 115static int spi_resume(struct device *dev)
127{ 116{
128 struct pci_dev *pdev = to_pci_dev(dev); 117 struct pci_dev *pdev = to_pci_dev(dev);
129 struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); 118 struct dw_spi *dws = pci_get_drvdata(pdev);
130 119
131 return dw_spi_resume_host(&dwpci->dws); 120 return dw_spi_resume_host(dws);
132} 121}
133#endif 122#endif
134 123