1 From 2e5fba82e4aeb72d71230eef2541881615aaf7cf Mon Sep 17 00:00:00 2001
2 From: Miquel Raynal <miquel.raynal@bootlin.com>
3 Date: Thu, 27 Jan 2022 10:18:00 +0100
4 Subject: [PATCH 06/15] spi: spi-mem: Kill the spi_mem_dtr_supports_op() helper
6 Now that spi_mem_default_supports_op() has access to the static
7 controller capabilities (relating to memory operations), and now that
8 these capabilities have been filled by the relevant controllers, there
9 is no need for a specific helper checking only DTR operations, so let's
10 just kill spi_mem_dtr_supports_op() and simply use
11 spi_mem_default_supports_op() instead.
13 Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
14 Reviewed-by: Pratyush Yadav <p.yadav@ti.com>
15 Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
16 Reviewed-by: Tudor Ambarus <tudor.ambarus@microchip.com>
17 Link: https://lore.kernel.org/linux-mtd/20220127091808.1043392-6-miquel.raynal@bootlin.com
18 (cherry picked from commit 9a15efc5d5e6b5beaed0883e5bdcd0b1384c1b20)
20 drivers/spi/spi-cadence-quadspi.c | 5 +----
21 drivers/spi/spi-mem.c | 10 ----------
22 drivers/spi/spi-mxic.c | 10 +---------
23 include/linux/spi/spi-mem.h | 11 -----------
24 4 files changed, 2 insertions(+), 34 deletions(-)
26 diff --git a/drivers/spi/spi-cadence-quadspi.c b/drivers/spi/spi-cadence-quadspi.c
27 index 101cc71bffa7..2c98d6a9a2aa 100644
28 --- a/drivers/spi/spi-cadence-quadspi.c
29 +++ b/drivers/spi/spi-cadence-quadspi.c
30 @@ -1252,10 +1252,7 @@ static bool cqspi_supports_mem_op(struct spi_mem *mem,
31 if (!(all_true || all_false))
35 - return spi_mem_dtr_supports_op(mem, op);
37 - return spi_mem_default_supports_op(mem, op);
38 + return spi_mem_default_supports_op(mem, op);
41 static int cqspi_of_get_flash_pdata(struct platform_device *pdev,
42 diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
43 index 86e6597bc3dc..ed966d8129eb 100644
44 --- a/drivers/spi/spi-mem.c
45 +++ b/drivers/spi/spi-mem.c
46 @@ -160,16 +160,6 @@ static bool spi_mem_check_buswidth(struct spi_mem *mem,
50 -bool spi_mem_dtr_supports_op(struct spi_mem *mem,
51 - const struct spi_mem_op *op)
53 - if (op->cmd.nbytes != 2)
56 - return spi_mem_check_buswidth(mem, op);
58 -EXPORT_SYMBOL_GPL(spi_mem_dtr_supports_op);
60 bool spi_mem_default_supports_op(struct spi_mem *mem,
61 const struct spi_mem_op *op)
63 diff --git a/drivers/spi/spi-mxic.c b/drivers/spi/spi-mxic.c
64 index 45889947afed..e895df09896a 100644
65 --- a/drivers/spi/spi-mxic.c
66 +++ b/drivers/spi/spi-mxic.c
67 @@ -335,8 +335,6 @@ static int mxic_spi_data_xfer(struct mxic_spi *mxic, const void *txbuf,
68 static bool mxic_spi_mem_supports_op(struct spi_mem *mem,
69 const struct spi_mem_op *op)
73 if (op->data.buswidth > 8 || op->addr.buswidth > 8 ||
74 op->dummy.buswidth > 8 || op->cmd.buswidth > 8)
76 @@ -348,13 +346,7 @@ static bool mxic_spi_mem_supports_op(struct spi_mem *mem,
77 if (op->addr.nbytes > 7)
80 - all_false = !op->cmd.dtr && !op->addr.dtr && !op->dummy.dtr &&
84 - return spi_mem_default_supports_op(mem, op);
86 - return spi_mem_dtr_supports_op(mem, op);
87 + return spi_mem_default_supports_op(mem, op);
90 static int mxic_spi_mem_exec_op(struct spi_mem *mem,
91 diff --git a/include/linux/spi/spi-mem.h b/include/linux/spi/spi-mem.h
92 index 38e5d45c9842..4a1bfe689872 100644
93 --- a/include/linux/spi/spi-mem.h
94 +++ b/include/linux/spi/spi-mem.h
95 @@ -330,10 +330,6 @@ void spi_controller_dma_unmap_mem_op_data(struct spi_controller *ctlr,
97 bool spi_mem_default_supports_op(struct spi_mem *mem,
98 const struct spi_mem_op *op);
100 -bool spi_mem_dtr_supports_op(struct spi_mem *mem,
101 - const struct spi_mem_op *op);
105 spi_controller_dma_map_mem_op_data(struct spi_controller *ctlr,
106 @@ -356,13 +352,6 @@ bool spi_mem_default_supports_op(struct spi_mem *mem,
112 -bool spi_mem_dtr_supports_op(struct spi_mem *mem,
113 - const struct spi_mem_op *op)
117 #endif /* CONFIG_SPI_MEM */
119 int spi_mem_adjust_op_size(struct spi_mem *mem, struct spi_mem_op *op);