Re: [PATCH 2/3] rtc: add rtc controller support for Sophgo CV1800B SoC

From: Alexandre Belloni
Date: Tue Nov 28 2023 - 18:01:37 EST


On 28/11/2023 21:22:52+0800, jingbao qiu wrote:
> >
> > > + ret = cv1800b_rtc_softinit(rtc);
> > > + if (ret)
> > > + goto err;
> > > + cv1800b_rtc_alarm_irq_enable(&pdev->dev, 1);
> > > + rtc->rtc_dev = devm_rtc_allocate_device(&pdev->dev);
> > > + if (IS_ERR(rtc->rtc_dev)) {
> > > + ret = PTR_ERR(rtc->rtc_dev);
> > > + goto err;
> > > + }
> > > + rtc->rtc_dev->range_max = U32_MAX;
> > > + rtc->rtc_dev->ops = &cv800b_rtc_ops;
> > > +
> > > + return rtc_register_device(rtc->rtc_dev);
>
> I find the commet of devm_rtc_device_register wirte
> “This function is deprecated, use devm_rtc_allocate_device and
> rtc_register_device instead”
> but all of code about this, they all use devm_rtc_device_register

They don't, they use devm_rtc_register_device

> function. So which one do you suggest I use?
>
> > > +err:
> > > + return dev_err_probe(&pdev->dev, ret, "Failed to init cv1800b rtc\n");
> >
> > Drop, just return.
>
> ok
>
> >
> > Best regards,
> > Krzysztof
> >
>
> Best regards,
> Jingbao Qiu

--
Alexandre Belloni, co-owner and COO, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com