From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Marc Kleine-Budde <mkl@pengutronix.de>
Cc: linux-can@vger.kernel.org, netdev@vger.kernel.org,
linux-kernel@vger.kernel.org,
Manivannan Sadhasivam <mani@kernel.org>,
Thomas Kopp <thomas.kopp@microchip.com>,
Wolfgang Grandegger <wg@grandegger.com>,
"David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>
Subject: Re: [PATCH v2 1/2] can: mcp251xfd: Try to get crystal clock rate from property
Date: Mon, 31 May 2021 12:58:29 +0300 [thread overview]
Message-ID: <YLSzRdpp9EWsLeFy@smile.fi.intel.com> (raw)
In-Reply-To: <20210531084720.6xql2r4uhp6ruzl6@pengutronix.de>
On Mon, May 31, 2021 at 10:47:20AM +0200, Marc Kleine-Budde wrote:
> On 26.05.2021 22:33:26, Andy Shevchenko wrote:
> > In some configurations, mainly ACPI-based, the clock frequency of the device
> > is supplied by very well established 'clock-frequency' property. Hence, try
> > to get it from the property at last if no other providers are available.
> > return dev_err_probe(&spi->dev, PTR_ERR(reg_xceiver),
> > "Failed to get Transceiver regulator!\n");
> >
> > - clk = devm_clk_get(&spi->dev, NULL);
> > + /* Always ask for fixed clock rate from a property. */
> > + device_property_read_u32(&spi->dev, "clock-frequency", &rate);
>
> what about error handling....?
Not needed, but rate should be assigned to 0, which is missed.
> > + clk = devm_clk_get_optional(&spi->dev, NULL);
> > if (IS_ERR(clk))
> > return dev_err_probe(&spi->dev, PTR_ERR(clk),
> > "Failed to get Oscillator (clock)!\n");
> > freq = clk_get_rate(clk);
> > + if (freq == 0)
> > + freq = rate;
>
> ... this means we don't fail if there is neither a clk nor a
> clock-frequency property.
The following will check for it (which is already in the code)
if (freq <= MCP251XFD_SYSCLOCK_HZ_MAX / MCP251XFD_OSC_PLL_MULTIPLIER) {
> I've send a v3 to fix this.
You mean I have to send v3?
Sure!
--
With Best Regards,
Andy Shevchenko
next prev parent reply other threads:[~2021-05-31 10:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-26 19:33 [PATCH v2 1/2] can: mcp251xfd: Try to get crystal clock rate from property Andy Shevchenko
2021-05-26 19:33 ` [PATCH v2 2/2] can: mcp251xfd: Fix header block to clarify independence from OF Andy Shevchenko
2021-05-31 8:47 ` [PATCH v2 1/2] can: mcp251xfd: Try to get crystal clock rate from property Marc Kleine-Budde
2021-05-31 9:58 ` Andy Shevchenko [this message]
2021-05-31 10:03 ` Andy Shevchenko
2021-05-31 10:03 ` Marc Kleine-Budde
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=YLSzRdpp9EWsLeFy@smile.fi.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=davem@davemloft.net \
--cc=kuba@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mani@kernel.org \
--cc=mkl@pengutronix.de \
--cc=netdev@vger.kernel.org \
--cc=thomas.kopp@microchip.com \
--cc=wg@grandegger.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).