Browse Source

intel: Remove un-needed checks for qspi driver r/w

This patch removes un-needed r/w parameter checks for qspi driver. The
driver can actually access any offset and size.

Signed-off-by: Hadi Asyrafi <muhammad.hadi.asyrafi.abdul.halim@intel.com>
Change-Id: If60b2c016aa91e2c24ddc57c6ad410c8dc5dcf53
pull/1937/head
Hadi Asyrafi 5 years ago
parent
commit
f6c4b19ac8
  1. 11
      plat/intel/soc/common/drivers/qspi/cadence_qspi.c

11
plat/intel/soc/common/drivers/qspi/cadence_qspi.c

@ -688,10 +688,7 @@ int cad_qspi_read(void *buffer, uint32_t offset, uint32_t size)
if ((offset >= qspi_device_size) || if ((offset >= qspi_device_size) ||
(offset + size - 1 >= qspi_device_size) || (offset + size - 1 >= qspi_device_size) ||
(size == 0) || (size == 0)) {
((long) ((int *)buffer) & 0x3) ||
(offset & 0x3) ||
(size & 0x3)) {
ERROR("Invalid read parameter\n"); ERROR("Invalid read parameter\n");
return -1; return -1;
} }
@ -766,11 +763,9 @@ int cad_qspi_write(void *buffer, uint32_t offset, uint32_t size)
if ((offset >= qspi_device_size) || if ((offset >= qspi_device_size) ||
(offset + size - 1 >= qspi_device_size) || (offset + size - 1 >= qspi_device_size) ||
(size == 0) || (size == 0)) {
((long)buffer & 0x3) ||
(offset & 0x3) ||
(size & 0x3))
return -2; return -2;
}
if (CAD_QSPI_INDWR_RDSTAT(mmio_read_32(CAD_QSPI_OFFSET + if (CAD_QSPI_INDWR_RDSTAT(mmio_read_32(CAD_QSPI_OFFSET +
CAD_QSPI_INDWR))) { CAD_QSPI_INDWR))) {

Loading…
Cancel
Save