The patch fixes following checkpatch.pl issue:
WARNING : braces {} are not necessary for single statement blocks
Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The patch fixes following checkpatch.pl issue:
ERROR : space required before the open parenthesis
Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The patch fixes following checkpatch.pl issue:
ERROR : code indent should use tabs where possible
Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The patch fixes following checkpatch.pl issue:
ERROR : switch and case should be at the same indent
Signed-off-by: Sankalp Negi <sankalpnegi2310@gmail.com>
Reviewed-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
The mt7621 SPI engine has a 32 byte buffer and the driver
currently only allows 32-byte read requests and 36 bytes writes
(there is a 4byte op/addr buffer).
This is an unnecessary limitation. As the SPI clock is controlled
by the host it is quite acceptable to send a larger message in
multiple smaller transactions. As long as Chip Select is kept asserted
the whole time, the SPI engine can be run multiple times for
a single SPI message.
This patch factors out the transaction logic and calls for each
transfer in the message. A write transfer might leave bytes in the
buffer to be combined with a following read transfer, as this is
a common pattern.
With this in place, we can remove the current max_transfer_size limit.
In testing, this increases the read throughput for a NOR flash chip
from 1.4MB/s to 2.3MB/s, a 50% improvement.
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
All callers have a 'struct mt7621_spi' and that is all
mt7621_spi_wait_till_ready() needs. So just pass it
instead of the spi_device.
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This lock is never initialized, locked once, and never unlocked.
Clearly it is pointless - so remove it.
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Remove the owner assignment form the platform driver as
platform_driver_register() already initializes the owner.
Found using coccinelle.
Signed-off-by: Christian Lütke-Stetzkamp <christian@lkamp.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
NeilBrown:
The code will fail with a warning if asked to transfer
more than 32 bytes at a time. So used max_transfer_size
interface to tell users about this.
Signed-off-by: John Crispin <blogic@openwrt.org>
Signed-off-by: NeilBrown <neil@brown.name>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>