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
This commit is contained in:
Hadi Asyrafi 2020-01-13 16:26:22 +08:00
parent 436367966f
commit f6c4b19ac8

View File

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