mirror of
https://github.com/torvalds/linux.git
synced 2026-07-27 17:47:41 +02:00
rtc: ab8500: Simplify driver_data handling
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>
This commit is contained in:
parent
ba5dca876b
commit
6e2f1f0184
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user