diff options
| author | Jassi Brar <[email protected]> | 2023-03-06 17:18:41 -0600 |
|---|---|---|
| committer | Tom Rini <[email protected]> | 2023-06-09 13:52:40 -0400 |
| commit | 246ec2a12c437ff821e452104f3f564e5d25fa91 (patch) | |
| tree | bd9fa8bf397e9ba9b0e9c4664099336db822ef2c /cmd/fwu_mdata.c | |
| parent | 3733e16925ec7470d93dff7209ef881ea7d95dd2 (diff) | |
fwu: meta-data: switch to management by common code
The common code can now read, verify and fix meta-data copies
while exposing one consistent structure to users.
Only the .read_mdata() and .write_mdata() callbacks of fwu_mdata_ops
are needed. Get rid of .get_mdata() .update_mdata() .get_mdata_part_num()
.read_mdata_partition() and .write_mdata_partition() and also the
corresponding wrapper functions.
Signed-off-by: Jassi Brar <[email protected]>
Reviewed-by: Etienne Carriere <[email protected]>
Reviewed-by: Ilias Apalodimas <[email protected]>
Tested-by: Sughosh Ganu <[email protected]>
Diffstat (limited to 'cmd/fwu_mdata.c')
| -rw-r--r-- | cmd/fwu_mdata.c | 17 |
1 files changed, 2 insertions, 15 deletions
diff --git a/cmd/fwu_mdata.c b/cmd/fwu_mdata.c index f04af27de63..9b70340368a 100644 --- a/cmd/fwu_mdata.c +++ b/cmd/fwu_mdata.c @@ -43,23 +43,10 @@ static void print_mdata(struct fwu_mdata *mdata) int do_fwu_mdata_read(struct cmd_tbl *cmdtp, int flag, int argc, char * const argv[]) { - struct udevice *dev; int ret = CMD_RET_SUCCESS, res; - struct fwu_mdata mdata = { 0 }; + struct fwu_mdata mdata; - if (uclass_get_device(UCLASS_FWU_MDATA, 0, &dev) || !dev) { - log_err("Unable to get FWU metadata device\n"); - return CMD_RET_FAILURE; - } - - res = fwu_check_mdata_validity(); - if (res < 0) { - log_err("FWU Metadata check failed\n"); - ret = CMD_RET_FAILURE; - goto out; - } - - res = fwu_get_mdata(dev, &mdata); + res = fwu_get_verified_mdata(&mdata); if (res < 0) { log_err("Unable to get valid FWU metadata\n"); ret = CMD_RET_FAILURE; |
