summaryrefslogtreecommitdiffstats
path: root/src/barebox-state/backend_storage.c
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2017-03-22 12:36:40 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2017-03-31 13:57:45 +0200
commitcd8b5954c6a6e918dae96dd14ff605a819e08d51 (patch)
tree7561aed797ac21f92eb55cbf0859b00c64e86ac6 /src/barebox-state/backend_storage.c
parent86a5a1df39cf8dce9a685239f347284a3494aa06 (diff)
downloaddt-utils-cd8b5954c6a6e918dae96dd14ff605a819e08d51.tar.gz
dt-utils-cd8b5954c6a6e918dae96dd14ff605a819e08d51.tar.xz
state: pass struct state * to storage functions
We can get a state_backend_storage * and the device * from struct state, so pass this to the storage functions rather than the two pointers. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'src/barebox-state/backend_storage.c')
-rw-r--r--src/barebox-state/backend_storage.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/barebox-state/backend_storage.c b/src/barebox-state/backend_storage.c
index ee7ff06..c619b3e 100644
--- a/src/barebox-state/backend_storage.c
+++ b/src/barebox-state/backend_storage.c
@@ -455,7 +455,6 @@ static int state_storage_file_buckets_init(struct state_backend_storage *storage
/**
* state_storage_init - Init backend storage
- * @param storage Storage object
* @param path Path to the backend storage file
* @param dev_offset Offset in the device to start writing at.
* @param max_size Maximum size of the data. May be 0 for infinite.
@@ -466,16 +465,16 @@ static int state_storage_file_buckets_init(struct state_backend_storage *storage
*
* Depending on the filetype, we create mtd buckets or normal file buckets.
*/
-int state_storage_init(struct state_backend_storage *storage,
- struct device_d *dev, const char *path,
+int state_storage_init(struct state *state, const char *path,
off_t offset, size_t max_size, uint32_t stridesize,
const char *storagetype)
{
+ struct state_backend_storage *storage = &state->storage;
int ret;
struct mtd_info_user meminfo;
INIT_LIST_HEAD(&storage->buckets);
- storage->dev = dev;
+ storage->dev = &state->dev;
storage->name = storagetype;
storage->stridesize = stridesize;