[PATCH v3 2/3] board: Add support for Sielaff i.MX6 Solo board
Frieder Schrempf
frieder.schrempf at kontron.de
Tue Feb 20 09:38:01 CET 2024
Hi Dan,
On 20.02.24 06:56, Dan Carpenter wrote:
> On Thu, Feb 15, 2024 at 02:35:20PM +0100, Frieder Schrempf wrote:
>> +int board_mmc_getcd(struct mmc *mmc)
>
> This function is never called. Also for bool functions make them type
> bool and name them so that it's clear they return true/false such as
> board_mmc_getcd_was_successful() but less wordy.
What makes you think so? This is an implementation for the existing
prototype from mmc.h. As far as I can see this is called by the mmc
driver and I can't change it in any way.
>
>> +{
>> + struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv;
>> + int ret = 0;
>> +
>> + switch (cfg->esdhc_base) {
>> + case USDHC3_BASE_ADDR:
>> + ret = !gpio_get_value(USDHC3_CD_GPIO);
>> + break;
>> + }
>> +
>> + return ret;
>> +}
>> +
>> +int board_mmc_init(struct bd_info *bis)
>> +{
>> + int i, ret;
>> +
>> + /*
>> + * According to the board_mmc_init() the following map is done:
>> + * (U-boot device node) (Physical Port)
>> + * mmc0 USDHC1
>> + * mmc1 USDHC2
>> + */
>> + for (i = 0; i < CFG_SYS_FSL_USDHC_NUM; i++) {
>> + switch (i) {
>> + case 0:
>> + imx_iomux_v3_setup_multiple_pads(usdhc3_pads,
>> + ARRAY_SIZE(usdhc3_pads));
>> + gpio_direction_input(USDHC3_CD_GPIO);
>> + usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK);
>> + break;
>> + default:
>> + printf("Warning: you configured more USDHC controllers \
>> + (%d) than supported by the board\n", i + 1);
>> + return -EINVAL;
>
> This will look weird if it's ever printed:
>
> "Warning: you configured more USDHC controllers (%d) than supported by the board\n"
>
> There is a checkpatch warnings for this.
>
> WARNING: Avoid line continuations in quoted strings
> #1137: FILE: board/sielaff/imx6dl-sielaff/spl.c:96:
> + printf("Warning: you configured more USDHC controllers \
Agreed. Fabio already applied this to his tree. I can send a fixup for this.
Thanks
Frieder
More information about the U-Boot
mailing list