netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Simon Horman <horms@verge.net.au>
Cc: "Geert Uytterhoeven" <geert+renesas@glider.be>,
	"David S . Miller" <davem@davemloft.net>,
	"Sergei Shtylyov" <sergei.shtylyov@cogentembedded.com>,
	"Niklas Söderlund" <niklas.soderlund+renesas@ragnatech.se>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>
Subject: Re: [PATCH] ravb: Consolidate clock handling
Date: Thu, 12 Oct 2017 14:20:45 +0200	[thread overview]
Message-ID: <CAMuHMdUpvrWpyiAo2qT=5JWHU+jpbDgV8LuvF0-+pC825XQMeg@mail.gmail.com> (raw)
In-Reply-To: <20171012095508.vjpqvq37474qp2cb@verge.net.au>

Hi Simon,

On Thu, Oct 12, 2017 at 11:55 AM, Simon Horman <horms@verge.net.au> wrote:
> On Thu, Oct 12, 2017 at 10:24:53AM +0200, Geert Uytterhoeven wrote:
>> The module clock is used for two purposes:
>>   - Wake-on-LAN (WoL), which is optional,
>>   - gPTP Timer Increment (GTI) configuration, which is mandatory.
>>
>> As the clock is needed for GTI configuration anyway, WoL is always
>> available.  Hence remove duplication and repeated obtaining of the clock
>> by making GTI use the stored clock for WoL use.
>
> Hi Geert,
>
> I understand from the statements above that the clock must be present,
> but I'm most sure that I understand why that means that WoL is always
> available.

That refers to the part below: WoL was considered available iff the clock
is available.

@@ -2073,10 +2058,11 @@ static int ravb_probe(struct platform_device *pdev)

        priv->chip_id = chip_id;

-       /* Get clock, if not found that's OK but Wake-On-Lan is unavailable */
        priv->clk = devm_clk_get(&pdev->dev, NULL);
-       if (IS_ERR(priv->clk))
-               priv->clk = NULL;
+       if (IS_ERR(priv->clk)) {
+               error = PTR_ERR(priv->clk);
+               goto out_release;
+       }

But the clock must always be available, else GTI configuration
would fail, and ravb initialization would return with an error.

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2017-10-12 12:20 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-10-12  8:24 [PATCH] ravb: Consolidate clock handling Geert Uytterhoeven
2017-10-12  9:55 ` Simon Horman
2017-10-12 12:20   ` Geert Uytterhoeven [this message]
2017-10-13  8:05     ` Simon Horman
2017-10-12 13:46 ` Niklas Söderlund
2017-10-12 19:31 ` Sergei Shtylyov
2017-10-13  6:01 ` David Miller

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='CAMuHMdUpvrWpyiAo2qT=5JWHU+jpbDgV8LuvF0-+pC825XQMeg@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=davem@davemloft.net \
    --cc=geert+renesas@glider.be \
    --cc=horms@verge.net.au \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=niklas.soderlund+renesas@ragnatech.se \
    --cc=sergei.shtylyov@cogentembedded.com \
    /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).