linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@gmail.com>
To: Adam Ford <aford173@gmail.com>, linux-renesas-soc@vger.kernel.org
Cc: aford@beaconembedded.com, charles.stevens@logicpd.com,
	"David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC] ravb: Add support for optional txc_refclk
Date: Sat, 12 Dec 2020 20:54:58 +0300	[thread overview]
Message-ID: <7f5f8ef2-3e4f-5076-0558-26b48e75b674@gmail.com> (raw)
In-Reply-To: <20201212165648.166220-1-aford173@gmail.com>

Hello!

On 12.12.2020 19:56, Adam Ford wrote:

> The SoC expects the txv_refclk is provided, but if it is provided
> by a programmable clock, there needs to be a way to get and enable
> this clock to operate.  It needs to be optional since it's only
> necessary for those with programmable clocks.
> 
> Signed-off-by: Adam Ford <aford173@gmail.com>
[...]
> diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c
> index bd30505fbc57..4c3f95923ef2 100644
> --- a/drivers/net/ethernet/renesas/ravb_main.c
> +++ b/drivers/net/ethernet/renesas/ravb_main.c
> @@ -2148,6 +2148,18 @@ static int ravb_probe(struct platform_device *pdev)
>   		goto out_release;
>   	}
>   
> +	priv->ref_clk = devm_clk_get(&pdev->dev, "txc_refclk");

    Why not devm_clk_get_optional()?

> +	if (IS_ERR(priv->ref_clk)) {
> +		if (PTR_ERR(priv->ref_clk) == -EPROBE_DEFER) {
> +			/* for Probe defer return error */
> +			error = PTR_ERR(priv->ref_clk);
> +			goto out_release;
> +		}
> +		/* Ignore other errors since it's optional */
> +	} else {
> +		(void)clk_prepare_enable(priv->ref_clk);
> +	}
> +
>   	ndev->max_mtu = 2048 - (ETH_HLEN + VLAN_HLEN + ETH_FCS_LEN);
>   	ndev->min_mtu = ETH_MIN_MTU;
>   

MBR, Sergei

  reply	other threads:[~2020-12-12 17:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-12 16:56 [RFC] ravb: Add support for optional txc_refclk Adam Ford
2020-12-12 17:54 ` Sergei Shtylyov [this message]
2020-12-12 19:38   ` Adam Ford
2020-12-14 10:05 ` Geert Uytterhoeven
2020-12-28 13:49   ` Adam Ford
2020-12-28 16:17     ` Geert Uytterhoeven

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=7f5f8ef2-3e4f-5076-0558-26b48e75b674@gmail.com \
    --to=sergei.shtylyov@gmail.com \
    --cc=aford173@gmail.com \
    --cc=aford@beaconembedded.com \
    --cc=charles.stevens@logicpd.com \
    --cc=davem@davemloft.net \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).