From: Arun Muthusamy <arun.muthusamy@gaisler.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: robh@kernel.org, krzk+dt@kernel.org, conor+dt@kernel.org,
mkl@pengutronix.de, mailhol@kernel.org,
Cc <devicetree@vger.kernel.org>,
linux-kernel@vger.kernel.org, linux-can@vger.kernel.org,
Daniel Hellstrom <daniel@gaisler.com>
Subject: Re: [PATCH 04/10] can: grcan: Add clock handling
Date: Mon, 24 Nov 2025 10:46:43 +0100 [thread overview]
Message-ID: <43591fac5bf0df7c6c7c5426f00a2437@gaisler.com> (raw)
In-Reply-To: <bd81118a-5ee3-476e-a7bc-61684a362eea@kernel.org>
Hi Krzysztof,
Thank you for your thorough review. I wanted to get your guidance
regarding the clock property in the DT binding.
In the binding, I included the clocks property with maxItems: 1 to
indicate that a clock should be described. The driver calls:
clk = devm_clk_get(dev, NULL);
Since we pass NULL, the driver always requests the first (and only)
clock from the clocks property.
I want to ensure the binding is fully compliant with the Linux DT ABI.
Could you advise the preferred way to document the clocks and
clock-names properties in this scenario? Specifically:
Do we still need a clock-names entry even if the driver never uses it by
name?
For LEON systems, the driver relies on the "freq" property, while NOEL
systems use a standard "clocks" binding. Given this dual approach,
should the clocks property be marked as optional or required in the
binding?
Thank you for your time and help.
--
BR,
Arun Muthusamy
Software Engineer
Frontgrade Gaisler
T : +46 (0) 700 558 528
arun.muthusamy@gaisler.com
Frontgrade Gaisler AB, Kungsgatan 12, SE-411 19 GÖTEBORG, Sweden.
+46 (0) 31 775 8650, www.gaisler.com
On 18.11.2025 12:01, Krzysztof Kozlowski wrote:
> On 18/11/2025 10:21, Arun Muthusamy wrote:
>> From: Daniel Hellstrom <daniel@gaisler.com>
>>
>> Add clock handling and add error messages for missing 'freq' DT
>> property.
>>
>> Signed-off-by: Arun Muthusamy <arun.muthusamy@gaisler.com>
>> Signed-off-by: Daniel Hellstrom <daniel@gaisler.com>
>> ---
>> drivers/net/can/grcan.c | 19 ++++++++++++++++---
>> 1 file changed, 16 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/net/can/grcan.c b/drivers/net/can/grcan.c
>> index 3b1b09943436..538a9b4f82ab 100644
>> --- a/drivers/net/can/grcan.c
>> +++ b/drivers/net/can/grcan.c
>> @@ -34,7 +34,7 @@
>> #include <linux/spinlock.h>
>> #include <linux/of.h>
>> #include <linux/of_irq.h>
>> -
>> +#include <linux/clk.h>
>> #include <linux/dma-mapping.h>
>>
>> #define DRV_NAME "grcan"
>> @@ -1644,6 +1644,7 @@ static int grcan_probe(struct platform_device
>> *ofdev)
>> {
>> struct device_node *np = ofdev->dev.of_node;
>> struct device_node *sysid_parent;
>> + struct clk *clk;
>> u32 sysid, ambafreq;
>> int irq, err;
>> void __iomem *base;
>> @@ -1663,8 +1664,20 @@ static int grcan_probe(struct platform_device
>> *ofdev)
>>
>> err = of_property_read_u32(np, "freq", &ambafreq);
>> if (err) {
>> - dev_err(&ofdev->dev, "unable to fetch \"freq\" property\n");
>> - goto exit_error;
>> + clk = devm_clk_get(&ofdev->dev, NULL);
>
> Nope, your binding said there is no clock... you cannot add
> undocumented
> ABI.
>
>
> Best regards,
> Krzysztof
next prev parent reply other threads:[~2025-11-24 9:46 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-11-18 9:21 [PATCH 00/10] can: grcan: Enhance driver with CANFD Support and Improvements Arun Muthusamy
2025-11-18 9:21 ` [PATCH 01/10] dt-bindings: Add vendor prefix for Frontgrade Gaisler AB Arun Muthusamy
2025-11-18 10:56 ` Krzysztof Kozlowski
2025-11-18 9:21 ` [PATCH 02/10] dt-bindings: net: can: grcan: Convert GRCAN CAN controllers binding from txt to YAML Arun Muthusamy
2025-11-18 11:01 ` Krzysztof Kozlowski
2025-11-24 9:37 ` Arun Muthusamy
2025-11-24 11:28 ` Krzysztof Kozlowski
2025-12-11 10:11 ` Arun Muthusamy
2025-11-18 9:21 ` [PATCH 03/10] MAINTAINERS: Add entry for GRCAN CAN network driver Arun Muthusamy
2025-11-18 9:21 ` [PATCH 04/10] can: grcan: Add clock handling Arun Muthusamy
2025-11-18 11:01 ` Krzysztof Kozlowski
2025-11-24 9:46 ` Arun Muthusamy [this message]
2025-11-24 11:10 ` Krzysztof Kozlowski
2025-11-18 9:21 ` [PATCH 05/10] can: grcan: add FD capability detection and nominal bit-timing Arun Muthusamy
2025-11-21 10:52 ` Marc Kleine-Budde
2025-11-18 9:21 ` [PATCH 06/10] can: grcan: optimize DMA by 32-bit accesses Arun Muthusamy
2025-11-21 11:00 ` Marc Kleine-Budde
2025-11-18 9:21 ` [PATCH 07/10] can: grcan: set DMA mask for GRCAN and GRCANFD to 32-bit Arun Muthusamy
2025-11-21 12:46 ` Marc Kleine-Budde
2025-11-18 9:21 ` [PATCH 08/10] can: grcan: Add saving and restoring of CAN FD baud-rate registers Arun Muthusamy
2025-11-21 12:50 ` Marc Kleine-Budde
2025-12-11 9:13 ` Arun Muthusamy
2025-12-11 11:37 ` Marc Kleine-Budde
2025-11-18 9:21 ` [PATCH 09/10] can: grcan: Reserve space between cap and next register to align with address layout Arun Muthusamy
2025-11-18 9:21 ` [PATCH 10/10] can: grcan: Add CANFD support alongside legacy CAN Arun Muthusamy
2025-11-21 13: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=43591fac5bf0df7c6c7c5426f00a2437@gaisler.com \
--to=arun.muthusamy@gaisler.com \
--cc=conor+dt@kernel.org \
--cc=daniel@gaisler.com \
--cc=devicetree@vger.kernel.org \
--cc=krzk+dt@kernel.org \
--cc=krzk@kernel.org \
--cc=linux-can@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mailhol@kernel.org \
--cc=mkl@pengutronix.de \
--cc=robh@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).