Hi Loic,
Hi All,
After bumping the kernel within OpenWrt to 4.14.95, a user reported a
build error on a specific platform (ipq806x):
drivers/mmc/host/sdhci-msm.c:1158:3: error: 'const struct sdhci_ops' has
no member named 'write_w'
.write_w = sdhci_msm_write_w,
^~~~~~~
drivers/mmc/host/sdhci-msm.c:1158:13: warning: excess elements in struct
initializer
.write_w = sdhci_msm_write_w,
^~~~~~~~~~~~~~~~~
drivers/mmc/host/sdhci-msm.c:1158:13: note: (near initialization for
'sdhci_msm_ops')
scripts/Makefile.build:326: recipe for target
'drivers/mmc/host/sdhci-msm.o' failed
The reason is found within commit [1]: 4abb6960f61c ("mmc: sdhci-msm:
Disable CDR function on TX")
which contains following hunk:
@@ -1107,6 +1155,7 @@ static const struct sdhci_ops sdhci_msm_ops = {
.set_bus_width = sdhci_set_bus_width,
.set_uhs_signaling = sdhci_msm_set_uhs_signaling,
.voltage_switch = sdhci_msm_voltage_switch,
+ .write_w = sdhci_msm_write_w,
};
static const struct sdhci_pltfm_data sdhci_msm_pdata = {
Looking at the structure definition in sdhci.h, it seems this param is
optional, defined by symbol CONFIG_MMC_SDHCI_IO_ACCESSORS:
struct sdhci_ops {
#ifdef CONFIG_MMC_SDHCI_IO_ACCESSORS
u32 (*read_l)(struct sdhci_host *host, int reg);
u16 (*read_w)(struct sdhci_host *host, int reg);
u8 (*read_b)(struct sdhci_host *host, int reg);
void (*write_l)(struct sdhci_host *host, u32 val,
int reg);
void (*write_w)(struct sdhci_host *host, u16 val,
int reg);
void (*write_b)(struct sdhci_host *host, u8 val, int
reg);
#endif
Where in the assignment in this patch hunk, the assignment is not
conditional, resulting in the build failure.
How should this properly be handled?
Should the assignment also be conditional depending on this symbol?
Thank you,
Koen
[1]
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=v4.14.95&id=4abb6960f61ca52ff5a61c97bde10e9e7edf548e