Commit 108607ce authored by Andy Shevchenko's avatar Andy Shevchenko Committed by Mark Brown

spi: pxa2xx-pci: Move port_id assignment to ->setup()

Instead of using conditional, move port_id to the corresponding
->setup() functions.
Signed-off-by: default avatarAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20220225172350.69797-4-andriy.shevchenko@linux.intel.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
parent 1d9d6295
...@@ -29,7 +29,7 @@ enum { ...@@ -29,7 +29,7 @@ enum {
struct pxa_spi_info { struct pxa_spi_info {
enum pxa_ssp_type type; enum pxa_ssp_type type;
int port_id; unsigned int port_id;
unsigned int num_chipselect; unsigned int num_chipselect;
unsigned long max_clk_rate; unsigned long max_clk_rate;
...@@ -116,6 +116,7 @@ static int lpss_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) ...@@ -116,6 +116,7 @@ static int lpss_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
static int ce4100_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) static int ce4100_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
{ {
c->port_id = dev->devfn;
c->num_chipselect = dev->devfn; c->num_chipselect = dev->devfn;
c->max_clk_rate = 3686400; c->max_clk_rate = 3686400;
...@@ -169,6 +170,7 @@ static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) ...@@ -169,6 +170,7 @@ static int mrfld_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
static int qrk_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) static int qrk_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
{ {
c->port_id = dev->devfn;
c->num_chipselect = 1; c->num_chipselect = 1;
c->max_clk_rate = 50000000; c->max_clk_rate = 50000000;
...@@ -178,7 +180,6 @@ static int qrk_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c) ...@@ -178,7 +180,6 @@ static int qrk_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
static struct pxa_spi_info spi_info_configs[] = { static struct pxa_spi_info spi_info_configs[] = {
[PORT_CE4100] = { [PORT_CE4100] = {
.type = PXA25x_SSP, .type = PXA25x_SSP,
.port_id = -1,
.setup = ce4100_spi_setup, .setup = ce4100_spi_setup,
}, },
[PORT_BYT] = { [PORT_BYT] = {
...@@ -216,7 +217,6 @@ static struct pxa_spi_info spi_info_configs[] = { ...@@ -216,7 +217,6 @@ static struct pxa_spi_info spi_info_configs[] = {
}, },
[PORT_QUARK_X1000] = { [PORT_QUARK_X1000] = {
.type = QUARK_X1000_SSP, .type = QUARK_X1000_SSP,
.port_id = -1,
.setup = qrk_spi_setup, .setup = qrk_spi_setup,
}, },
[PORT_LPT0] = { [PORT_LPT0] = {
...@@ -271,8 +271,8 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev, ...@@ -271,8 +271,8 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
ssp->dev = &dev->dev; ssp->dev = &dev->dev;
ssp->phys_base = pci_resource_start(dev, 0); ssp->phys_base = pci_resource_start(dev, 0);
ssp->mmio_base = pcim_iomap_table(dev)[0]; ssp->mmio_base = pcim_iomap_table(dev)[0];
ssp->port_id = (c->port_id >= 0) ? c->port_id : dev->devfn;
ssp->type = c->type; ssp->type = c->type;
ssp->port_id = c->port_id;
pci_set_master(dev); pci_set_master(dev);
......
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