All of lore.kernel.org
 help / color / mirror / Atom feed
* [LINUX PATCH 2/3] spi: spi-mem: call spi_mem_default_supports_op() first
@ 2019-03-28 11:16 ` Naga Sureshkumar Relli
  0 siblings, 0 replies; 14+ messages in thread
From: Naga Sureshkumar Relli @ 2019-03-28 11:16 UTC (permalink / raw)
  To: broonie, bbrezillon
  Cc: Naga Sureshkumar Relli, vigneshr, richard, linux-kernel,
	linux-spi, marek.vasut, linux-mtd, nagasuresh12, dwmw2,
	michal.simek

Call spi_mem_default_supports_op() first, before calling controller
specific ctlr->supports_op().
With this, controller drivers can drop checking the buswidths again.

Suggested-by: Vignesh Raghavendra <vigneshr@ti.com>
Signed-off-by: Naga Sureshkumar Relli <naga.sureshkumar.relli@xilinx.com>
---
Details can be found at https://lkml.org/lkml/2019/3/1/183
---
 drivers/spi/spi-mem.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/spi/spi-mem.c b/drivers/spi/spi-mem.c
index 5217a56..56aa158 100644
--- a/drivers/spi/spi-mem.c
+++ b/drivers/spi/spi-mem.c
@@ -189,11 +189,14 @@ static bool spi_mem_internal_supports_op(struct spi_mem *mem,
 					 const struct spi_mem_op *op)
 {
 	struct spi_controller *ctlr = mem->spi->controller;
+	bool ret;
+
+	ret = spi_mem_default_supports_op(mem, op);
 
 	if (ctlr->mem_ops && ctlr->mem_ops->supports_op)
-		return ctlr->mem_ops->supports_op(mem, op);
+		ret =  ctlr->mem_ops->supports_op(mem, op);
 
-	return spi_mem_default_supports_op(mem, op);
+	return ret;
 }
 
 /**
-- 
2.7.4


______________________________________________________
Linux MTD discussion mailing list
http://lists.infradead.org/mailman/listinfo/linux-mtd/

^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2019-03-29 11:09 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-03-28 11:16 [LINUX PATCH 2/3] spi: spi-mem: call spi_mem_default_supports_op() first Naga Sureshkumar Relli
2019-03-28 11:16 ` Naga Sureshkumar Relli
2019-03-28 19:55 ` Boris Brezillon
2019-03-28 19:55   ` Boris Brezillon
2019-03-29  8:20   ` Vignesh Raghavendra
2019-03-29  8:20     ` Vignesh Raghavendra
2019-03-29  8:53     ` Boris Brezillon
2019-03-29  8:53       ` Boris Brezillon
2019-03-29 11:01       ` Vignesh Raghavendra
2019-03-29 11:01         ` Vignesh Raghavendra
2019-03-29 11:01   ` Vignesh Raghavendra
2019-03-29 11:01     ` Vignesh Raghavendra
2019-03-29 11:08     ` Naga Sureshkumar Relli
2019-03-29 11:08       ` Naga Sureshkumar Relli

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.