aboutsummaryrefslogtreecommitdiff
path: root/common
diff options
context:
space:
mode:
authorMarek BehĂșn2024-05-21 09:13:25 +0200
committerTom Rini2024-06-07 10:47:59 -0600
commita804c8dc5f5e3760948e5ef22f5c605af9cfc695 (patch)
tree6b1650fd570bc5b8be1f2946687da415f1bb335b /common
parentd4781422d1268aa6deca3e49d2fb227e79c160b4 (diff)
common: eeprom_layout: Assign default layout methods and parameters before specific ones
Assign the default eeprom layout parameter .data_size and methods .print() and .update() before calling eeprom_layout_assign() in eeprom_layout_setup(). This allows eeprom_layout_assign() to overwrite these if needed. Signed-off-by: Marek BehĂșn <kabel@kernel.org>
Diffstat (limited to 'common')
-rw-r--r--common/eeprom/eeprom_layout.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/common/eeprom/eeprom_layout.c b/common/eeprom/eeprom_layout.c
index 5a9be1da061..406db3f7d15 100644
--- a/common/eeprom/eeprom_layout.c
+++ b/common/eeprom/eeprom_layout.c
@@ -111,14 +111,14 @@ void eeprom_layout_setup(struct eeprom_layout *layout, unsigned char *buf,
else
layout->layout_version = layout_version;
+ layout->data_size = buf_size;
+ layout->print = eeprom_layout_print;
+ layout->update = eeprom_layout_update_field;
+
eeprom_layout_assign(layout, layout_version);
layout->data = buf;
for (i = 0; i < layout->num_of_fields; i++) {
layout->fields[i].buf = buf;
buf += layout->fields[i].size;
}
-
- layout->data_size = buf_size;
- layout->print = eeprom_layout_print;
- layout->update = eeprom_layout_update_field;
}