All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Mark Brown <broonie@kernel.org>
Subject: [PATCH v1 05/11] spi: pxa2xx-pci: Move dma_burst_size assignment to ->setup()
Date: Fri, 25 Feb 2022 19:23:44 +0200	[thread overview]
Message-ID: <20220225172350.69797-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220225172350.69797-1-andriy.shevchenko@linux.intel.com>

Instead of using conditional, move dma_burst_size to the corresponding
->setup() function.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-pxa2xx-pci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 87629da3e544..c2cbb002784a 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -38,7 +38,7 @@ struct pxa_spi_info {
 	void *tx_param;
 	void *rx_param;
 
-	int dma_burst_size;
+	unsigned int dma_burst_size;
 
 	int (*setup)(struct pci_dev *pdev, struct pxa_spi_info *c);
 };
@@ -111,6 +111,7 @@ static int lpss_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
 	}
 
 	c->dma_filter = lpss_dma_filter;
+	c->dma_burst_size = 1;
 	return 0;
 }
 
@@ -265,7 +266,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
 	spi_pdata.tx_param = c->tx_param;
 	spi_pdata.rx_param = c->rx_param;
 	spi_pdata.enable_dma = c->rx_param && c->tx_param;
-	spi_pdata.dma_burst_size = c->dma_burst_size ? c->dma_burst_size : 1;
+	spi_pdata.dma_burst_size = c->dma_burst_size;
 
 	ssp = &spi_pdata.ssp;
 	ssp->dev = &dev->dev;
-- 
2.34.1


WARNING: multiple messages have this Message-ID (diff)
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
	linux-arm-kernel@lists.infradead.org, linux-spi@vger.kernel.org,
	linux-kernel@vger.kernel.org
Cc: Daniel Mack <daniel@zonque.org>,
	Haojian Zhuang <haojian.zhuang@gmail.com>,
	Robert Jarzmik <robert.jarzmik@free.fr>,
	Mark Brown <broonie@kernel.org>
Subject: [PATCH v1 05/11] spi: pxa2xx-pci: Move dma_burst_size assignment to ->setup()
Date: Fri, 25 Feb 2022 19:23:44 +0200	[thread overview]
Message-ID: <20220225172350.69797-5-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20220225172350.69797-1-andriy.shevchenko@linux.intel.com>

Instead of using conditional, move dma_burst_size to the corresponding
->setup() function.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/spi/spi-pxa2xx-pci.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-pxa2xx-pci.c b/drivers/spi/spi-pxa2xx-pci.c
index 87629da3e544..c2cbb002784a 100644
--- a/drivers/spi/spi-pxa2xx-pci.c
+++ b/drivers/spi/spi-pxa2xx-pci.c
@@ -38,7 +38,7 @@ struct pxa_spi_info {
 	void *tx_param;
 	void *rx_param;
 
-	int dma_burst_size;
+	unsigned int dma_burst_size;
 
 	int (*setup)(struct pci_dev *pdev, struct pxa_spi_info *c);
 };
@@ -111,6 +111,7 @@ static int lpss_spi_setup(struct pci_dev *dev, struct pxa_spi_info *c)
 	}
 
 	c->dma_filter = lpss_dma_filter;
+	c->dma_burst_size = 1;
 	return 0;
 }
 
@@ -265,7 +266,7 @@ static int pxa2xx_spi_pci_probe(struct pci_dev *dev,
 	spi_pdata.tx_param = c->tx_param;
 	spi_pdata.rx_param = c->rx_param;
 	spi_pdata.enable_dma = c->rx_param && c->tx_param;
-	spi_pdata.dma_burst_size = c->dma_burst_size ? c->dma_burst_size : 1;
+	spi_pdata.dma_burst_size = c->dma_burst_size;
 
 	ssp = &spi_pdata.ssp;
 	ssp->dev = &dev->dev;
-- 
2.34.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

  parent reply	other threads:[~2022-02-25 17:24 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-25 17:23 [PATCH v1 01/11] spi: pxa2xx-pci: Refactor CE4100 to use ->setup() Andy Shevchenko
2022-02-25 17:23 ` Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 02/11] spi: pxa2xx-pci: Refactor Quark X1000 " Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 03/11] spi: pxa2xx-pci: Drop redundant NULL check in ->probe() Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 04/11] spi: pxa2xx-pci: Move port_id assignment to ->setup() Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-25 17:23 ` Andy Shevchenko [this message]
2022-02-25 17:23   ` [PATCH v1 05/11] spi: pxa2xx-pci: Move dma_burst_size " Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 06/11] spi: pxa2xx-pci: Move max_clk_rate " Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 07/11] spi: pxa2xx-pci: Replace enum with direct use of PCI IDs Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 08/11] spi: pxa2xx-pci: Drop unneeded checks in lpss_spi_setup() Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 09/11] spi: pxa2xx-pci: Extract pxa2xx_spi_pci_clk_register() Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 10/11] spi: pxa2xx-pci: Drop temporary storage use for a handful of members Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-25 17:23 ` [PATCH v1 11/11] spi: pxa2xx-pci: Constify struct pxa_spi_info variables Andy Shevchenko
2022-02-25 17:23   ` Andy Shevchenko
2022-02-28 22:00 ` [PATCH v1 01/11] spi: pxa2xx-pci: Refactor CE4100 to use ->setup() Mark Brown
2022-02-28 22:00   ` Mark Brown

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220225172350.69797-5-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=broonie@kernel.org \
    --cc=daniel@zonque.org \
    --cc=haojian.zhuang@gmail.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-spi@vger.kernel.org \
    --cc=robert.jarzmik@free.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.