]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
rtc: ab8500: Simplify driver_data handling
authorUwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Thu, 28 May 2026 06:48:11 +0000 (08:48 +0200)
committerAlexandre Belloni <alexandre.belloni@bootlin.com>
Mon, 22 Jun 2026 00:22:42 +0000 (02:22 +0200)
Instead of hiding the rtc ops for the only supported device behind an
abstraction for multi-device support, hardcode the used ops which gets rid
of the need to call platform_get_device_id and two casts.

Signed-off-by: Uwe Kleine-König (The Capable Hub) <u.kleine-koenig@baylibre.com>
Reviewed-by: Linus Walleij <linusw@kernel.org>
Link: https://patch.msgid.link/a909d3c59d00756130ac16051ceedbec0ce9cec7.1779950275.git.u.kleine-koenig@baylibre.com
Signed-off-by: Alexandre Belloni <alexandre.belloni@bootlin.com>
drivers/rtc/rtc-ab8500.c

index c6147837f9570d60d8fa584393556dac3443a425..0978bd0a33931d7f82fc2beb0d0bc7d32f61f495 100644 (file)
@@ -323,14 +323,13 @@ static const struct rtc_class_ops ab8500_rtc_ops = {
 };
 
 static const struct platform_device_id ab85xx_rtc_ids[] = {
-       { "ab8500-rtc", (kernel_ulong_t)&ab8500_rtc_ops, },
+       { .name = "ab8500-rtc" },
        { /* sentinel */ }
 };
 MODULE_DEVICE_TABLE(platform, ab85xx_rtc_ids);
 
 static int ab8500_rtc_probe(struct platform_device *pdev)
 {
-       const struct platform_device_id *platid = platform_get_device_id(pdev);
        int err;
        struct rtc_device *rtc;
        u8 rtc_ctrl;
@@ -366,7 +365,7 @@ static int ab8500_rtc_probe(struct platform_device *pdev)
        if (IS_ERR(rtc))
                return PTR_ERR(rtc);
 
-       rtc->ops = (struct rtc_class_ops *)platid->driver_data;
+       rtc->ops = &ab8500_rtc_ops;
 
        err = devm_request_threaded_irq(&pdev->dev, irq, NULL,
                        rtc_alarm_handler, IRQF_ONESHOT,