int err;
/* Read for a header, parse or error out. */
- spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, 0x40,
+ spi_flash_read(flash, CONFIG_SYS_SPI_KERNEL_OFFS, sizeof(*header),
(void *)header);
if (image_get_magic(header) != IH_MAGIC)
return -ENODEV;
}
- header = spl_get_load_buffer(-sizeof(*header), 0x40);
+ header = spl_get_load_buffer(-sizeof(*header), sizeof(*header));
#if CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)
payload_offs = fdtdec_get_config_int(gd->fdt_blob,
#endif
{
/* Load u-boot, mkimage header is 64 bytes. */
- err = spi_flash_read(flash, payload_offs, 0x40,
+ err = spi_flash_read(flash, payload_offs, sizeof(*header),
(void *)header);
if (err) {
debug("%s: Failed to read from SPI flash (err=%d)\n",