Commit 1c2df965 authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

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: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1cc3f141
...@@ -23,11 +23,6 @@ ...@@ -23,11 +23,6 @@
#define DRIVER_NAME "dw_spi_pci" #define DRIVER_NAME "dw_spi_pci"
struct dw_spi_pci {
struct pci_dev *pdev;
struct dw_spi dws;
};
struct spi_pci_desc { struct spi_pci_desc {
int (*setup)(struct dw_spi *); int (*setup)(struct dw_spi *);
u16 num_cs; u16 num_cs;
...@@ -48,7 +43,6 @@ static struct spi_pci_desc spi_pci_mid_desc_2 = { ...@@ -48,7 +43,6 @@ static struct spi_pci_desc spi_pci_mid_desc_2 = {
static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
{ {
struct dw_spi_pci *dwpci;
struct dw_spi *dws; struct dw_spi *dws;
struct spi_pci_desc *desc = (struct spi_pci_desc *)ent->driver_data; struct spi_pci_desc *desc = (struct spi_pci_desc *)ent->driver_data;
int pci_bar = 0; int pci_bar = 0;
...@@ -58,14 +52,10 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -58,14 +52,10 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
if (ret) if (ret)
return ret; return ret;
dwpci = devm_kzalloc(&pdev->dev, sizeof(struct dw_spi_pci), dws = devm_kzalloc(&pdev->dev, sizeof(*dws), GFP_KERNEL);
GFP_KERNEL); if (!dws)
if (!dwpci)
return -ENOMEM; return -ENOMEM;
dwpci->pdev = pdev;
dws = &dwpci->dws;
/* Get basic io resource and map it */ /* Get basic io resource and map it */
dws->paddr = pci_resource_start(pdev, pci_bar); dws->paddr = pci_resource_start(pdev, pci_bar);
...@@ -74,7 +64,6 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -74,7 +64,6 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return ret; return ret;
dws->regs = pcim_iomap_table(pdev)[pci_bar]; dws->regs = pcim_iomap_table(pdev)[pci_bar];
dws->irq = pdev->irq; dws->irq = pdev->irq;
/* /*
...@@ -99,7 +88,7 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -99,7 +88,7 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
return ret; return ret;
/* PCI hook and SPI hook use the same drv data */ /* PCI hook and SPI hook use the same drv data */
pci_set_drvdata(pdev, dwpci); pci_set_drvdata(pdev, dws);
dev_info(&pdev->dev, "found PCI SPI controller(ID: %04x:%04x)\n", dev_info(&pdev->dev, "found PCI SPI controller(ID: %04x:%04x)\n",
pdev->vendor, pdev->device); pdev->vendor, pdev->device);
...@@ -109,26 +98,26 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -109,26 +98,26 @@ static int spi_pci_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
static void spi_pci_remove(struct pci_dev *pdev) static void spi_pci_remove(struct pci_dev *pdev)
{ {
struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); struct dw_spi *dws = pci_get_drvdata(pdev);
dw_spi_remove_host(&dwpci->dws); dw_spi_remove_host(dws);
} }
#ifdef CONFIG_PM_SLEEP #ifdef CONFIG_PM_SLEEP
static int spi_suspend(struct device *dev) static int spi_suspend(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); struct dw_spi *dws = pci_get_drvdata(pdev);
return dw_spi_suspend_host(&dwpci->dws); return dw_spi_suspend_host(dws);
} }
static int spi_resume(struct device *dev) static int spi_resume(struct device *dev)
{ {
struct pci_dev *pdev = to_pci_dev(dev); struct pci_dev *pdev = to_pci_dev(dev);
struct dw_spi_pci *dwpci = pci_get_drvdata(pdev); struct dw_spi *dws = pci_get_drvdata(pdev);
return dw_spi_resume_host(&dwpci->dws); return dw_spi_resume_host(dws);
} }
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment