Re: [PATCH v9 7/7] rtc: Add Nuvoton NCT6694 RTC support
From: Krzysztof Kozlowski
Date: Thu Apr 10 2025 - 04:03:49 EST
On 09/04/2025 10:27, a0282524688@xxxxxxxxx wrote:
> + data->irq = irq;
> + data->nct6694 = nct6694;
> + data->rtc->ops = &nct6694_rtc_ops;
> + data->rtc->range_min = RTC_TIMESTAMP_BEGIN_2000;
> + data->rtc->range_max = RTC_TIMESTAMP_END_2099;
> +
> + platform_set_drvdata(pdev, data);
> +
> + ret = devm_request_threaded_irq(&pdev->dev, irq, NULL,
> + nct6694_irq, IRQF_ONESHOT,
> + "rtc-nct6694", data);
> + if (ret < 0) {
> + dev_err_probe(&pdev->dev, ret, "Failed to request irq\n");
> + goto dispose_irq;
> + }
> +
> + ret = devm_rtc_register_device(data->rtc);
> + if (ret)
> + goto dispose_irq;
> +
> + device_init_wakeup(&pdev->dev, true);
devm_device_init_wakeup
Let's save us from one more patch...
As pointed out in other patch by Bartosz, you have messed cleanups. Use
only devm, because currently your cleanup looks like this:
1. dispose mapping
2. free IRQ
and this should be reversed.
Best regards,
Krzysztof