Skip to content

Commit

Permalink
spi: spi-zynq-qspi: Remove multiple instances of clock enable
Browse files Browse the repository at this point in the history
The driver was enabling pclk, refclk and the qspi controller at multiple
instances. The clocks and the controller should be enabled only once so
update the driver to enable the clocks & the controller only once.

Addresses-coverity: Unchecked return value (CHECKED_RETURN)

Signed-off-by: Amit Kumar Mahapatra <amit.kumar-mahapatra@xilinx.com>
  • Loading branch information
Amit Kumar Mahapatra authored and michalsimek committed Apr 28, 2022
1 parent dab62ac commit 02d5e2d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions drivers/spi/spi-zynq-qspi.c
Expand Up @@ -234,8 +234,6 @@ static void zynq_qspi_init_hw(struct zynq_qspi *xqspi, unsigned int num_cs)
(1 << ZYNQ_QSPI_LCFG_DUMMY_SHIFT) |
ZYNQ_QSPI_FAST_READ_QOUT_CODE));
#endif
zynq_qspi_write(xqspi, ZYNQ_QSPI_ENABLE_OFFSET,
ZYNQ_QSPI_ENABLE_ENABLE_MASK);
}

static bool zynq_qspi_supports_op(struct spi_mem *mem,
Expand Down Expand Up @@ -405,8 +403,6 @@ static int zynq_qspi_setup_op(struct spi_device *spi)
if (ctlr->busy)
return -EBUSY;

clk_enable(qspi->refclk);
clk_enable(qspi->pclk);
zynq_qspi_write(qspi, ZYNQ_QSPI_ENABLE_OFFSET,
ZYNQ_QSPI_ENABLE_ENABLE_MASK);

Expand Down

0 comments on commit 02d5e2d

Please sign in to comment.