summaryrefslogtreecommitdiffstats
path: root/opaque.c
diff options
context:
space:
mode:
authorCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2014-07-19 22:03:29 +0000
committerCarl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>2014-07-19 22:03:29 +0000
commita5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa (patch)
tree5daecd880a16b7011be28e064fb7550f3e6b7e58 /opaque.c
parent82b6ec1df30d3fca55547f230c76718d6e613b2a (diff)
downloadflashrom-a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa.tar.gz
flashrom-a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa.tar.bz2
flashrom-a5bcbceb581f27cfc0055369d3dd9cfd1ae00bfa.zip
Rename programmer registration functions
Register_programmer suggests that we register a programmer. However, that function registers a master for a given bus type, and a programmer may support multiple masters (e.g. SPI, FWH). Rename a few other functions to be more consistent. Corresponding to flashrom svn r1831. Signed-off-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net> Acked-by: Stefan Tauner <stefan.tauner@alumni.tuwien.ac.at>
Diffstat (limited to 'opaque.c')
-rw-r--r--opaque.c30
1 files changed, 15 insertions, 15 deletions
diff --git a/opaque.c b/opaque.c
index c63919f88..a5a829c6a 100644
--- a/opaque.c
+++ b/opaque.c
@@ -1,7 +1,7 @@
/*
* This file is part of the flashrom project.
*
- * Copyright (C) 2011 Carl-Daniel Hailfinger
+ * Copyright (C) 2011,2013,2014 Carl-Daniel Hailfinger
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -18,10 +18,10 @@
*/
/*
- * Contains the opaque programmer framework.
- * An opaque programmer is a programmer which does not provide direct access
+ * Contains the opaque master framework.
+ * An opaque master is a master which does not provide direct access
* to the flash chip and which abstracts all flash chip properties into a
- * programmer specific interface.
+ * master specific interface.
*/
#include <stdint.h>
@@ -32,35 +32,35 @@
int probe_opaque(struct flashctx *flash)
{
- return flash->pgm->opaque.probe(flash);
+ return flash->mst->opaque.probe(flash);
}
int read_opaque(struct flashctx *flash, uint8_t *buf, unsigned int start, unsigned int len)
{
- return flash->pgm->opaque.read(flash, buf, start, len);
+ return flash->mst->opaque.read(flash, buf, start, len);
}
int write_opaque(struct flashctx *flash, const uint8_t *buf, unsigned int start, unsigned int len)
{
- return flash->pgm->opaque.write(flash, buf, start, len);
+ return flash->mst->opaque.write(flash, buf, start, len);
}
int erase_opaque(struct flashctx *flash, unsigned int blockaddr, unsigned int blocklen)
{
- return flash->pgm->opaque.erase(flash, blockaddr, blocklen);
+ return flash->mst->opaque.erase(flash, blockaddr, blocklen);
}
-int register_opaque_programmer(const struct opaque_programmer *pgm)
+int register_opaque_master(const struct opaque_master *mst)
{
- struct registered_programmer rpgm;
+ struct registered_master rmst;
- if (!pgm->probe || !pgm->read || !pgm->write || !pgm->erase) {
- msg_perr("%s called with incomplete programmer definition. "
+ if (!mst->probe || !mst->read || !mst->write || !mst->erase) {
+ msg_perr("%s called with incomplete master definition. "
"Please report a bug at flashrom@flashrom.org\n",
__func__);
return ERROR_FLASHROM_BUG;
}
- rpgm.buses_supported = BUS_PROG;
- rpgm.opaque = *pgm;
- return register_programmer(&rpgm);
+ rmst.buses_supported = BUS_PROG;
+ rmst.opaque = *mst;
+ return register_master(&rmst);
}