summaryrefslogtreecommitdiffstats
path: root/spi.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-25 01:17:58 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2012-08-25 01:17:58 +0000
commit5a7cb847f096dacb0bf96b3aa909f79d76ae8204 (patch)
treeda511e990c1fdded61ee5dcefae38314c3a5a6cc /spi.c
parentdd73d830f7370b5f0bbdaa0780b0ff8d6ff1776a (diff)
downloadast2050-flashrom-5a7cb847f096dacb0bf96b3aa909f79d76ae8204.zip
ast2050-flashrom-5a7cb847f096dacb0bf96b3aa909f79d76ae8204.tar.gz
Make struct flashchip a field in struct flashctx instead of a complete copy
All the driver conversion work and cleanup has been done by Stefan. flashrom.c and cli_classic.c are a joint work of Stefan and Carl-Daniel. Corresponding to flashrom svn r1579. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Signed-off-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>
Diffstat (limited to 'spi.c')
-rw-r--r--spi.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/spi.c b/spi.c
index 62e1430..732f4c5 100644
--- a/spi.c
+++ b/spi.c
@@ -111,16 +111,16 @@ int spi_chip_read(struct flashctx *flash, uint8_t *buf, unsigned int start,
* means 0xffffff, the highest unsigned 24bit number.
*/
addrbase = spi_get_valid_read_addr(flash);
- if (addrbase + flash->total_size * 1024 > (1 << 24)) {
+ if (addrbase + flash->chip->total_size * 1024 > (1 << 24)) {
msg_perr("Flash chip size exceeds the allowed access window. ");
msg_perr("Read will probably fail.\n");
/* Try to get the best alignment subject to constraints. */
- addrbase = (1 << 24) - flash->total_size * 1024;
+ addrbase = (1 << 24) - flash->chip->total_size * 1024;
}
/* Check if alignment is native (at least the largest power of two which
* is a factor of the mapped size of the chip).
*/
- if (ffs(flash->total_size * 1024) > (ffs(addrbase) ? : 33)) {
+ if (ffs(flash->chip->total_size * 1024) > (ffs(addrbase) ? : 33)) {
msg_perr("Flash chip is not aligned natively in the allowed "
"access window.\n");
msg_perr("Read will probably return garbage.\n");
OpenPOWER on IntegriCloud