diff mbox series

[v6,2/5] spi: dw: Move "dw_spi_can_dma" function

Message ID 20230414120520.360291-3-joychakr@google.com (mailing list archive)
State Superseded
Headers show
Series spi: dw: DW SPI DMA Driver updates | expand

Commit Message

Joy Chakraborty April 14, 2023, 12:05 p.m. UTC
Move "dw_spi_can_dma" function implementation below
"dw_spi_dma_convert_width" function for handing compile dependency in
future patches.

Signed-off-by: Joy Chakraborty <joychakr@google.com>
---
 drivers/spi/spi-dw-dma.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

Comments

Andy Shevchenko April 17, 2023, 10:43 a.m. UTC | #1
On Fri, Apr 14, 2023 at 12:05:17PM +0000, Joy Chakraborty wrote:
> Move "dw_spi_can_dma" function implementation below
> "dw_spi_dma_convert_width" function for handing compile dependency in
> future patches.

We refer to the functions like func().

...

> +static bool dw_spi_can_dma(struct spi_controller *master,
> +			   struct spi_device *spi, struct spi_transfer *xfer)
> +{
> +	struct dw_spi *dws = spi_controller_get_devdata(master);
> +
> +	return xfer->len > dws->fifo_len;
> +}

> +
> +

Single blank line is enough.
Joy Chakraborty April 17, 2023, 12:11 p.m. UTC | #2
On Mon, Apr 17, 2023 at 4:13 PM Andy Shevchenko
<andriy.shevchenko@intel.com> wrote:
>
> On Fri, Apr 14, 2023 at 12:05:17PM +0000, Joy Chakraborty wrote:
> > Move "dw_spi_can_dma" function implementation below
> > "dw_spi_dma_convert_width" function for handing compile dependency in
> > future patches.
>
> We refer to the functions like func().
>
> ...
>
> > +static bool dw_spi_can_dma(struct spi_controller *master,
> > +                        struct spi_device *spi, struct spi_transfer *xfer)
> > +{
> > +     struct dw_spi *dws = spi_controller_get_devdata(master);
> > +
> > +     return xfer->len > dws->fifo_len;
> > +}
>
> > +
> > +
>
> Single blank line is enough.

Sure,I will make these changes and send V7.
Will wait for some time to see if Serge(y) has any other comments on
the patch series.

>
> --
> With Best Regards,
> Andy Shevchenko
>
>
diff mbox series

Patch

diff --git a/drivers/spi/spi-dw-dma.c b/drivers/spi/spi-dw-dma.c
index c1b42cb59965..75e1b11af7c9 100644
--- a/drivers/spi/spi-dw-dma.c
+++ b/drivers/spi/spi-dw-dma.c
@@ -198,14 +198,6 @@  static irqreturn_t dw_spi_dma_transfer_handler(struct dw_spi *dws)
 	return IRQ_HANDLED;
 }
 
-static bool dw_spi_can_dma(struct spi_controller *master,
-			   struct spi_device *spi, struct spi_transfer *xfer)
-{
-	struct dw_spi *dws = spi_controller_get_devdata(master);
-
-	return xfer->len > dws->fifo_len;
-}
-
 static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes)
 {
 	switch (n_bytes) {
@@ -220,6 +212,15 @@  static enum dma_slave_buswidth dw_spi_dma_convert_width(u8 n_bytes)
 	}
 }
 
+static bool dw_spi_can_dma(struct spi_controller *master,
+			   struct spi_device *spi, struct spi_transfer *xfer)
+{
+	struct dw_spi *dws = spi_controller_get_devdata(master);
+
+	return xfer->len > dws->fifo_len;
+}
+
+
 static int dw_spi_dma_wait(struct dw_spi *dws, unsigned int len, u32 speed)
 {
 	unsigned long long ms;