]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
common: eeprom_layout: Assign default layout methods and parameters before specific...
authorMarek Behún <kabel@kernel.org>
Tue, 21 May 2024 07:13:25 +0000 (09:13 +0200)
committerTom Rini <trini@konsulko.com>
Fri, 7 Jun 2024 16:47:59 +0000 (10:47 -0600)
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>
common/eeprom/eeprom_layout.c

index 5a9be1da061fe72c378a5692081fc1950fc4dd52..406db3f7d153d92c2af8f45502ecfc2a5cb29b50 100644 (file)
@@ -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;
 }