Linux RTC
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Rosen Penev <rosenp@gmail.com>
Cc: linux-rtc@vger.kernel.org,
	 Alexandre Belloni <alexandre.belloni@bootlin.com>,
	open list <linux-kernel@vger.kernel.org>,
	 linux-m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: [PATCH] rtc: msm6242: use devm_platform_ioremap_resource()
Date: Tue, 4 Aug 2026 16:31:02 +0200	[thread overview]
Message-ID: <CAMuHMdUmAd0dba9_EPdJkqw4kQubtKms03Ws8P-WfY__yxTEjA@mail.gmail.com> (raw)
In-Reply-To: <20260728005610.575268-1-rosenp@gmail.com>

CC linux-m68k

On Tue, 28 Jul 2026 at 02:56, Rosen Penev <rosenp@gmail.com> wrote:
> Replace the open-coded platform_get_resource() plus devm_ioremap()
> sequence with a single devm_platform_ioremap_resource() call, which folds
> the resource lookup and mapping into one step and returns an ERR_PTR on
> failure, checked with IS_ERR() and propagated via PTR_ERR().

Thanks for your patch!

> The rtc-msm6242 platform device (arch/m68k/amiga/platform.c) provides a
> single IORESOURCE_MEM window (0x00dc0000-0x00dcffff). It shares that
> resource definition with rtc-rp5c01, but the two are registered under the
> mutually exclusive A2000_CLK and A3000_CLK hardware flags, so only one
> RTC device exists on a given machine. The region reservation now
> performed by devm_platform_ioremap_resource() therefore introduces no
> conflict.

Any patches adding seemingly safe region reservations need testing on
actual hardware.

> Assisted-by: opencode:hy3-free
> Signed-off-by: Rosen Penev <rosenp@gmail.com>

> --- a/drivers/rtc/rtc-msm6242.c
> +++ b/drivers/rtc/rtc-msm6242.c
> @@ -188,21 +188,20 @@ static const struct rtc_class_ops msm6242_rtc_ops = {
>
>  static int __init msm6242_rtc_probe(struct platform_device *pdev)
>  {
> -       struct resource *res;
>         struct msm6242_priv *priv;
>         struct rtc_device *rtc;
> +       void __iomem *regs;
>
> -       res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
> -       if (!res)
> -               return -ENODEV;
> +       regs = devm_platform_ioremap_resource(pdev, 0);
> +       if (IS_ERR(regs))
> +               return PTR_ERR(regs);
>
>         priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL);
>         if (!priv)
>                 return -ENOMEM;
>
> -       priv->regs = devm_ioremap(&pdev->dev, res->start, resource_size(res));
> -       if (!priv->regs)
> -               return -ENOMEM;
> +       priv->regs = regs;
> +
>         platform_set_drvdata(pdev, priv);
>
>         rtc = devm_rtc_device_register(&pdev->dev, "rtc-msm6242",

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

      parent reply	other threads:[~2026-08-04 14:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-28  0:56 [PATCH] rtc: msm6242: use devm_platform_ioremap_resource() Rosen Penev
2026-07-28  1:01 ` sashiko-bot
2026-08-04 14:31 ` Geert Uytterhoeven [this message]

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=CAMuHMdUmAd0dba9_EPdJkqw4kQubtKms03Ws8P-WfY__yxTEjA@mail.gmail.com \
    --to=geert@linux-m68k.org \
    --cc=alexandre.belloni@bootlin.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-rtc@vger.kernel.org \
    --cc=rosenp@gmail.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