Re: [PATCH 2/2] mmc: cqe: Add CQE support for cadence mmc driver

From: Krzysztof Kozlowski

Date: Tue Apr 07 2026 - 07:30:56 EST


On 07/04/2026 13:18, rohan1sj via B4 Relay wrote:
> +static int sdhci_cdns_cqe_add_host(struct sdhci_host *host, struct platform_device *pdev)
> +{
> + struct cqhci_host *cq_host;
> + bool dma64;
> + int ret;
> +
> + /* setup SDHCI host first */
> + ret = sdhci_setup_host(host);
> +
> + if (ret)
> + return ret;
> +
> + /* Init CQE */
> + cq_host = cqhci_pltfm_init(pdev);
> + if (IS_ERR(cq_host)) {
> + ret = PTR_ERR(cq_host);
> + goto cleanup;
> + }
> +
> + dma64 = host->flags & SDHCI_USE_64_BIT_DMA;
> + if (dma64)
> + cq_host->caps |= CQHCI_TASK_DESC_SZ_128;
> +
> + cq_host->ops = &sdhci_cdns_cqhci_ops;
> +
> + host->mmc->caps2 |= MMC_CAP2_CQE | MMC_CAP2_CQE_DCMD;
> +
> + /* Finally initialize CQHCI */
> + ret = cqhci_init(cq_host, host->mmc, dma64);
> + if (ret) {
> + dev_err(mmc_dev(host->mmc), "Failed to initialize CQHCI: %d\n", ret);

So here error msg

> + goto cleanup;
> + }
> +
> + /* add host to MMC subsystem */
> + ret = __sdhci_add_host(host);
> + if (ret)
> + goto cleanup;
> +
> + dev_info(mmc_dev(host->mmc), "CQE init: success\n");

dev_dbg

This does not look like useful printk message. Drivers should be silent
on success:
https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/coding-style.rst#L913
https://elixir.bootlin.com/linux/v6.15-rc7/source/Documentation/process/debugging/driver_development_debugging_guide.rst#L79


> + return 0;
> +
> +cleanup:
> + dev_err(mmc_dev(host->mmc), "CQE init: failed for %s\n", mmc_hostname(host->mmc));

And here also error message. Why twice?

And if it is probe path, why aren't you using dev_err_probe()?

Best regards,
Krzysztof