spi: cadence-quadspi: drop cqspi_set_protocol()
authorMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Wed, 20 Apr 2022 15:56:15 +0000 (17:56 +0200)
committerMark Brown <broonie@kernel.org>
Mon, 25 Apr 2022 13:01:04 +0000 (14:01 +0100)
commit28ac902aedd18abf4faf8816b1bea6623d0e9509
tree1a5df13714d3cdd76389d763413043251125a133
parent2b8070840e6f48b5406ebe1630a0335843109799
spi: cadence-quadspi: drop cqspi_set_protocol()

As suggested, this removes the whole cqspi_set_protocol() function, as it
is not actually needed:

- Checks for unsupported operations are already handled by supports_op(),
  removing the need to distinguish DTR and non-DTR modes in the buswidth
  setup
- supports_op() ensures that the DTR flags match for all relevant parts of
  an operation, so op->cmd.dtr can be used instead of copying the flag to
  the cqspi_flash_pdata
- The logic in cqspi_set_protocol() is moved to cqspi_calc_rdreg() and
  cqspi_write_setup() (with a helper macro CQSPI_OP_WIDTH())

The helper macro checks nbytes instead of buswidth for 0, for consistency
with supports_op() etc.

Suggested-by: Pratyush Yadav <p.yadav@ti.com>
Signed-off-by: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20220420155616.281730-1-matthias.schiffer@ew.tq-group.com
Signed-off-by: Mark Brown <broonie@kernel.org>
drivers/spi/spi-cadence-quadspi.c