diff mbox series

[5/7] ata: ahci: mvebu: add clock support

Message ID 20181123101556.29888-6-miquel.raynal@bootlin.com (mailing list archive)
State Not Applicable, archived
Headers show
Series Bring suspend to RAM support to MVEBU SATA | expand

Commit Message

Miquel Raynal Nov. 23, 2018, 10:15 a.m. UTC
Add clock support to the ahci_mvebu.c driver. This is needed in order
to get suspend to RAM working.

Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
---
 drivers/ata/ahci_mvebu.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Miquel Raynal Nov. 29, 2018, 2:02 p.m. UTC | #1
Hello,

Miquel Raynal <miquel.raynal@bootlin.com> wrote on Fri, 23 Nov 2018
11:15:54 +0100:

> Add clock support to the ahci_mvebu.c driver. This is needed in order
> to get suspend to RAM working.
> 
> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
> ---
>  drivers/ata/ahci_mvebu.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
> index 902971bfe301..cad35806c3c2 100644
> --- a/drivers/ata/ahci_mvebu.c
> +++ b/drivers/ata/ahci_mvebu.c
> @@ -195,6 +195,16 @@ static int ahci_mvebu_probe(struct platform_device *pdev)
>  	if (!hpriv->plat_data)
>  		return -EINVAL;
>  
> +	/* The clock property is absent in old bindings */
> +	hpriv->clks[0] = devm_clk_get(&pdev->dev, NULL);
> +	if (IS_ERR(hpriv->clks[0])) {
> +		if (PTR_ERR(hpriv->clks[0]) == -EPROBE_DEFER)
> +			return PTR_ERR(hpriv->clks[0]);
> +
> +		dev_warn(&pdev->dev, "no clock available\n");
> +		hpriv->clks[0] = NULL;
> +	}
> +

During a debug session about clock device links I realized this patch
was not needed. The clk_get() on hpriv->clks[*] is done in
libahci_platform.c in ahci_platform_get_resources() so this is
redundant.

I'll fix it in the v2.

>  	rc = ahci_platform_enable_resources(hpriv);
>  	if (rc)
>  		return rc;


Thanks,
Miquèl
diff mbox series

Patch

diff --git a/drivers/ata/ahci_mvebu.c b/drivers/ata/ahci_mvebu.c
index 902971bfe301..cad35806c3c2 100644
--- a/drivers/ata/ahci_mvebu.c
+++ b/drivers/ata/ahci_mvebu.c
@@ -195,6 +195,16 @@  static int ahci_mvebu_probe(struct platform_device *pdev)
 	if (!hpriv->plat_data)
 		return -EINVAL;
 
+	/* The clock property is absent in old bindings */
+	hpriv->clks[0] = devm_clk_get(&pdev->dev, NULL);
+	if (IS_ERR(hpriv->clks[0])) {
+		if (PTR_ERR(hpriv->clks[0]) == -EPROBE_DEFER)
+			return PTR_ERR(hpriv->clks[0]);
+
+		dev_warn(&pdev->dev, "no clock available\n");
+		hpriv->clks[0] = NULL;
+	}
+
 	rc = ahci_platform_enable_resources(hpriv);
 	if (rc)
 		return rc;