diff mbox series

[v2,4/8] mmc: sdhci-pxav2: change clock name to match DT bindings

Message ID 20221202031330.94130-5-doug@schmorgal.com (mailing list archive)
State New, archived
Headers show
Series mmc: sdhci-pxav2: Add support for PXA168 | expand

Commit Message

Doug Brown Dec. 2, 2022, 3:13 a.m. UTC
The devicetree bindings for this driver specify that the two allowed
clock names are io and core. Change this driver to look for io, but
allow any name if it fails for backwards compatibility. Follow the same
pattern used in sdhci-pxav3.

Signed-off-by: Doug Brown <doug@schmorgal.com>
---
 drivers/mmc/host/sdhci-pxav2.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Adrian Hunter Dec. 22, 2022, 4:30 p.m. UTC | #1
On 2/12/22 05:13, Doug Brown wrote:
> The devicetree bindings for this driver specify that the two allowed
> clock names are io and core. Change this driver to look for io, but
> allow any name if it fails for backwards compatibility. Follow the same
> pattern used in sdhci-pxav3.
> 
> Signed-off-by: Doug Brown <doug@schmorgal.com>
> ---
>  drivers/mmc/host/sdhci-pxav2.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c
> index 0a16098b963f..509ba5dd4a4a 100644
> --- a/drivers/mmc/host/sdhci-pxav2.c
> +++ b/drivers/mmc/host/sdhci-pxav2.c
> @@ -189,7 +189,9 @@ static int sdhci_pxav2_probe(struct platform_device *pdev)
>  
>  	pltfm_host = sdhci_priv(host);
>  
> -	clk = devm_clk_get(dev, "PXA-SDHCLK");
> +	clk = devm_clk_get(dev, "io");
> +	if (IS_ERR(clk))
> +		clk = devm_clk_get(dev, NULL);
>  	if (IS_ERR(clk)) {
>  		dev_err(dev, "failed to get io clock\n");
>  		ret = PTR_ERR(clk);

It is nicer to handle EPROBE_DEFER e.g.

	if (IS_ERR(clk) && PTR_ERR(clk) != -EPROBE_DEFER)
		clk = devm_clk_get(dev, NULL);
	if (IS_ERR(clk)) {
		ret = PTR_ERR(clk);
		dev_err_probe(dev, ret, "failed to get io clock\n");
diff mbox series

Patch

diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c
index 0a16098b963f..509ba5dd4a4a 100644
--- a/drivers/mmc/host/sdhci-pxav2.c
+++ b/drivers/mmc/host/sdhci-pxav2.c
@@ -189,7 +189,9 @@  static int sdhci_pxav2_probe(struct platform_device *pdev)
 
 	pltfm_host = sdhci_priv(host);
 
-	clk = devm_clk_get(dev, "PXA-SDHCLK");
+	clk = devm_clk_get(dev, "io");
+	if (IS_ERR(clk))
+		clk = devm_clk_get(dev, NULL);
 	if (IS_ERR(clk)) {
 		dev_err(dev, "failed to get io clock\n");
 		ret = PTR_ERR(clk);