Linux RTC
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Fil Dunsky" <filipp.dunsky@gmail.com>
Cc: linux-rtc@vger.kernel.org, devicetree@vger.kernel.org,
	robh@kernel.org, conor+dt@kernel.org,
	"Alexandre Belloni" <alexandre.belloni@bootlin.com>
Subject: Re: [PATCH v7 2/3] rtc: Add Cortina Systems CS7542 RTC driver
Date: Fri, 04 Dec 2026 14:41:49 +0000	[thread overview]
Message-ID: <sashiko-outbox-250000@kernel.org> (raw)
In-Reply-To: <20261204-b4-cs7542-rtc-v7-2-21a0bd289ab8@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] rtc: cs75xx: g2_rtc_probe() advertises unsupported update
  interrupts
--

commit b35c72acbccf77fe94e04ebc8f568ba5d6a3a15b
Author: Fil Dunsky <filipp.dunsky@gmail.com>

rtc: Add Cortina Systems CS7542 RTC driver

This commit adds a platform RTC driver for the Cortina Systems CS7542
SoC supporting calendar reads and writes over years 0000-9999 without
alarm or interrupt support.

> diff --git a/drivers/rtc/rtc-cs75xx.c b/drivers/rtc/rtc-cs75xx.c
> new file mode 100644
> index 0000000000000..c51dcbd1273b0
> --- /dev/null
> +++ b/drivers/rtc/rtc-cs75xx.c
> @@ -0,0 +1,170 @@

[ ... ]

> +static int g2_rtc_probe(struct platform_device *pdev)
> +{
> +	struct device *dev = &pdev->dev;
> +	struct g2_rtc *p;
> +
> +	p = devm_kzalloc(dev, sizeof(*p), GFP_KERNEL);
> +	if (!p)
> +		return -ENOMEM;
> +
> +	p->base = devm_platform_ioremap_resource(pdev, 0);
> +	if (IS_ERR(p->base))
> +		return PTR_ERR(p->base);
> +
> +	platform_set_drvdata(pdev, p);
> +
> +	p->rtc = devm_rtc_allocate_device(dev);
> +	if (IS_ERR(p->rtc))
> +		return PTR_ERR(p->rtc);
> +	p->rtc->ops = &g2_rtcops;
> +	p->rtc->range_min = RTC_TIMESTAMP_BEGIN_0000;
> +	p->rtc->range_max = RTC_TIMESTAMP_END_9999;
> +
> +	return devm_rtc_register_device(p->rtc);
> +}

[Severity: Medium]
Should g2_rtc_probe() clear RTC_FEATURE_UPDATE_INTERRUPT in
p->rtc->features before calling devm_rtc_register_device()?

rtc_allocate_device() sets RTC_FEATURE_UPDATE_INTERRUPT by default, and
__devm_rtc_register_device() only clears RTC_FEATURE_ALARM when
set_alarm is NULL.  Without clearing it here, RTC_PARAM_GET for
RTC_PARAM_FEATURES advertises update interrupts as supported.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261204-b4-cs7542-rtc-v7-0-21a0bd289ab8@gmail.com?part=2

  reply	other threads:[~2026-12-04 14:41 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-04 14:03 [PATCH v7 0/3] rtc: Add Cortina Systems CS7542 calendar clock support Fil Dunsky via B4 Relay
2026-12-04 14:03 ` [PATCH v7 1/3] dt-bindings: rtc: Add Cortina Systems CS7542 RTC Fil Dunsky via B4 Relay
2026-12-04 14:03 ` [PATCH v7 2/3] rtc: Add Cortina Systems CS7542 RTC driver Fil Dunsky via B4 Relay
2026-12-04 14:41   ` sashiko-bot [this message]
2026-12-04 14:03 ` [PATCH v7 3/3] MAINTAINERS: Add Cortina Systems CS7542 RTC support Fil Dunsky via B4 Relay
2026-12-04 14:41 ` [PATCH v7 0/3] rtc: Add Cortina Systems CS7542 calendar clock support sashiko-bot

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=sashiko-outbox-250000@kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=filipp.dunsky@gmail.com \
    --cc=linux-rtc@vger.kernel.org \
    --cc=robh@kernel.org \
    --cc=sashiko-reviews@lists.linux.dev \
    /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