rtc: mv: convert to SPDX identifier
Alexandre Belloni
maintainerPATCH 1/3 rtc: mv: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.
The original text refers to version 2 so also update MODULE_LICENSE() to "GPL v2" instead of "GPL".
--- drivers/rtc/rtc-mv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-mv.c +2 -5
@@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for the RTC in Marvell SoCs. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. */ #include <linux/init.h>
@@ -322,5 +319,5 @@ module_platform_driver_probe(mv_rtc_driver, mv_rtc_probe);MODULE_AUTHOR ("Saeed Bishara <[email protected]>" );MODULE_DESCRIPTION ("Marvell RTC driver" ); -MODULE_LICENSE ("GPL" ); +MODULE_LICENSE ("GPL v2" );MODULE_ALIAS ("platform:rtc-mv" );
Signature · 1 line
2.20.1
Alexandre Belloni
maintainerPATCH 1/3 rtc: mv: convert to SPDX identifier
Use SPDX-License-Identifier instead of a verbose license text.
The original text refers to version 2 so also update MODULE_LICENSE() to "GPL v2" instead of "GPL".
--- drivers/rtc/rtc-mv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)
drivers/rtc/rtc-mv.c +2 -5
@@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for the RTC in Marvell SoCs. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. */ #include <linux/init.h>
@@ -322,5 +319,5 @@ module_platform_driver_probe(mv_rtc_driver, mv_rtc_probe);MODULE_AUTHOR ("Saeed Bishara <[email protected]>" );MODULE_DESCRIPTION ("Marvell RTC driver" ); -MODULE_LICENSE ("GPL" ); +MODULE_LICENSE ("GPL v2" );MODULE_ALIAS ("platform:rtc-mv" );
Signature · 1 line
2.20.1
Alexandre Belloni
maintainerPATCH 2/3 rtc: mv: convert to devm_rtc_allocate_device
In reply to Alexandre BelloniThis allows further improvement of the driver.
--- drivers/rtc/rtc-mv.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/rtc/rtc-mv.c +11 -10
@@ -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);
Signature · 1 line
2.20.1
Re: [PATCH 2/3] rtc: mv: convert to devm_rtc_allocate_device
Hi Alexandre,
Quoted 3 lines · Alexandre Belloni
This allows further improvement of the driver.
Signed-off-by Alexandre Belloni <[email protected]>
on Armada XP GP
Thanks,
Gregory
Quoted 51 lines
--- drivers/rtc/rtc-mv.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)drivers/rtc/rtc-mv.c +11
-10@@ -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);Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com
Alexandre Belloni
maintainerPATCH 2/3 rtc: mv: convert to devm_rtc_allocate_device
In reply to Alexandre BelloniThis allows further improvement of the driver.
--- drivers/rtc/rtc-mv.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-)
drivers/rtc/rtc-mv.c +11 -10
@@ -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);
Signature · 1 line
2.20.1
Alexandre Belloni
maintainerPATCH 3/3 rtc: mv: add range
In reply to Alexandre BelloniThis RTC handles time from 2000-01-01 00:00:00 to 2099-12-31 23:59:59 with a weird rollover to 2000-06-23 00:00:00.
--- drivers/rtc/rtc-mv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/rtc/rtc-mv.c +5 -2
@@ -57,7 +57,7 @@ static int mv_rtc_set_time(struct device *dev, struct rtc_time *tm) rtc_reg = (bin2bcd (tm->tm_mday) <<RTC_MDAY_OFFS ) | (bin2bcd (tm->tm_mon +1 ) <<RTC_MONTH_OFFS ) | - (bin2bcd (tm->tm_year %100 ) <<RTC_YEAR_OFFS ); + (bin2bcd (tm->tm_year -100 ) <<RTC_YEAR_OFFS );writel (rtc_reg, ioaddr +RTC_DATE_REG_OFFS );return 0 ;
@@ -156,7 +156,7 @@ static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) << RTC_MONTH_OFFS;if (alm->time.tm_year >=0 ) - rtc_reg |= (RTC_ALARM_VALID |bin2bcd (alm->time.tm_year %100 )) + rtc_reg |= (RTC_ALARM_VALID |bin2bcd (alm->time.tm_year -100 )) <<RTC_YEAR_OFFS ;writel (rtc_reg, ioaddr +RTC_ALARM_DATE_REG_OFFS );
@@ -277,6 +277,9 @@ static int __init mv_rtc_probe(struct platform_device *pdev) pdata->rtc->ops = &mv_rtc_ops; } + pdata->rtc->range_min =RTC_TIMESTAMP_BEGIN_2000 ; + pdata->rtc->range_max =RTC_TIMESTAMP_END_2099 ; + ret =rtc_register_device (pdata->rtc);if (!ret)return 0 ;
Signature · 1 line
2.20.1
Re: [PATCH 3/3] rtc: mv: add range
Hi Alexandre,
Quoted 4 lines · Alexandre Belloni
This RTC handles time from 2000-01-01 00:00:00 to 2099-12-31 23:59:59 with a weird rollover to 2000-06-23 00:00:00.
Signed-off-by Alexandre Belloni <[email protected]>
on Armada XP GP
Thanks,
Gregory
Quoted 44 lines
--- drivers/rtc/rtc-mv.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-)drivers/rtc/rtc-mv.c +5
-2@@ -57,7 +57,7 @@ static int mv_rtc_set_time(struct device *dev, struct rtc_time *tm) rtc_reg = (bin2bcd (tm->tm_mday) <<RTC_MDAY_OFFS ) | (bin2bcd (tm->tm_mon +1 ) <<RTC_MONTH_OFFS ) | - (bin2bcd (tm->tm_year %100 ) <<RTC_YEAR_OFFS ); + (bin2bcd (tm->tm_year -100 ) <<RTC_YEAR_OFFS );writel (rtc_reg, ioaddr +RTC_DATE_REG_OFFS );return 0 ;@@ -156,7 +156,7 @@ static int mv_rtc_set_alarm(struct device *dev, struct rtc_wkalrm *alm) << RTC_MONTH_OFFS;if (alm->time.tm_year >=0 ) - rtc_reg |= (RTC_ALARM_VALID |bin2bcd (alm->time.tm_year %100 )) + rtc_reg |= (RTC_ALARM_VALID |bin2bcd (alm->time.tm_year -100 )) <<RTC_YEAR_OFFS ;writel (rtc_reg, ioaddr +RTC_ALARM_DATE_REG_OFFS );@@ -277,6 +277,9 @@ static int __init mv_rtc_probe(struct platform_device *pdev) pdata->rtc->ops = &mv_rtc_ops; } + pdata->rtc->range_min =RTC_TIMESTAMP_BEGIN_2000 ; + pdata->rtc->range_max =RTC_TIMESTAMP_END_2099 ; + ret =rtc_register_device (pdata->rtc);if (!ret)return 0 ;Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com
Hi Alexandre,
Quoted 6 lines · Alexandre Belloni
Use SPDX-License-Identifier instead of a verbose license text.
The original text refers to version 2 so also update
MODULE_LICENSE()to "GPL v2" instead of "GPL".Signed-off-by Alexandre Belloni <[email protected]>
Thanks,
Gregory
Quoted 34 lines
--- drivers/rtc/rtc-mv.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-)drivers/rtc/rtc-mv.c +2
-5@@ -1,9 +1,6 @@ +// SPDX-License-Identifier: GPL-2.0 /* * Driver for the RTC in Marvell SoCs. -* -* This file is licensed under the terms of the GNU General Public -* License version 2. This program is licensed "as is" without any -* warranty of any kind, whether express or implied. */ #include <linux/init.h> @@ -322,5 +319,5 @@ module_platform_driver_probe(mv_rtc_driver, mv_rtc_probe);MODULE_AUTHOR ("Saeed Bishara <[email protected]>" );MODULE_DESCRIPTION ("Marvell RTC driver" ); -MODULE_LICENSE ("GPL" ); +MODULE_LICENSE ("GPL v2" );MODULE_ALIAS ("platform:rtc-mv" );Signature · 7 lines
2.20.1 _______________________________________________ linux-arm-kernel mailing list [email protected] http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Signature · 3 lines
Gregory Clement, Bootlin Embedded Linux and Kernel engineering http://bootlin.com