
Hello Pratyush, On Tue, Jan 19, 2021, at 11:06 PM, Pratyush Yadav wrote:
Hi Matthew,
Subject: [PATCH 1/3] mem: spi-mem: define spi_mem_default_supports_op
Nitpick: You are declaring spi_mem_default_supports_op() here. It is already defined. [snip]
This block of code was imported verbatim from the Linux driver and then wrapped around with a #ifndef __UBOOT__ to avoid compilation errors. So it will never get "enabled" in U-Boot ever. No driver can use the prototypes you have added.
And I tested this by applying your patch series and building the fsl_qspi driver using ls1012aqds_qspi_defconfig. Sure enough, the compiler reported "implicit declaration of function spi_mem_default_supports_op". Strangely, the linker did not complain and went through without errors. Not sure which function it would end up linking there.
Move the declaration outside this ifdef, right beside where spi_mem_supports_op() is declared. No need to have the variant below. It is safe to assume CONFIG_SPI_MEM is enabled if spi-mem.h is included.
Many thanks for your feedback - I did not account for the differences in the kernel and U-Boot here.
My revised patch should handle this correctly.
Best Regards, Mathew