Re: [PATCH 2/3] rtc: mv: convert to devm_rtc_allocate_device

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alexandre,
 
 On ven., mars 15 2019, Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx> wrote:

> This allows further improvement of the driver.
>
> Signed-off-by: Alexandre Belloni <alexandre.belloni@xxxxxxxxxxx>

Tested-by: Gregory CLEMENT <gregory.clement@xxxxxxxxxxx>

on Armada XP GP

Thanks,

Gregory

> ---
>  drivers/rtc/rtc-mv.c | 21 +++++++++++----------
>  1 file changed, 11 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mv.c b/drivers/rtc/rtc-mv.c
> index d13d06ea6709..ef704aef8663 100644
> --- a/drivers/rtc/rtc-mv.c
> +++ b/drivers/rtc/rtc-mv.c
> @@ -254,15 +254,7 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
>  
>  	platform_set_drvdata(pdev, pdata);
>  
> -	if (pdata->irq >= 0) {
> -		device_init_wakeup(&pdev->dev, 1);
> -		pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
> -						 &mv_rtc_alarm_ops,
> -						 THIS_MODULE);
> -	} else {
> -		pdata->rtc = devm_rtc_device_register(&pdev->dev, pdev->name,
> -						 &mv_rtc_ops, THIS_MODULE);
> -	}
> +	pdata->rtc = devm_rtc_allocate_device(&pdev->dev);
>  	if (IS_ERR(pdata->rtc)) {
>  		ret = PTR_ERR(pdata->rtc);
>  		goto out;
> @@ -278,7 +270,16 @@ static int __init mv_rtc_probe(struct platform_device *pdev)
>  		}
>  	}
>  
> -	return 0;
> +	if (pdata->irq >= 0) {
> +		device_init_wakeup(&pdev->dev, 1);
> +		pdata->rtc->ops = &mv_rtc_alarm_ops;
> +	} else {
> +		pdata->rtc->ops = &mv_rtc_ops;
> +	}
> +
> +	ret = rtc_register_device(pdata->rtc);
> +	if (!ret)
> +		return 0;
>  out:
>  	if (!IS_ERR(pdata->clk))
>  		clk_disable_unprepare(pdata->clk);
> -- 
> 2.20.1
>
>
> _______________________________________________
> linux-arm-kernel mailing list
> linux-arm-kernel@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

-- 
Gregory Clement, Bootlin
Embedded Linux and Kernel engineering
http://bootlin.com



[Index of Archives]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux