* [rtc-linux] [PATCH 1/4] rtc: gemini: using devm_rtc_device_register helper
@ 2017-01-25 8:41 ` Kefeng Wang
0 siblings, 0 replies; 8+ messages in thread
From: Kefeng Wang @ 2017-01-25 8:41 UTC (permalink / raw)
To: Hans Ulli Kroll, Alessandro Zummo, Alexandre Belloni,
Patrice Chotard, Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel,
rtc-linux
Cc: Kefeng Wang
Using devm_rtc_device_register() helper to simplify code.
Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/rtc/rtc-gemini.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c
index 688debc..504b6c1 100644
--- a/drivers/rtc/rtc-gemini.c
+++ b/drivers/rtc/rtc-gemini.c
@@ -145,26 +145,16 @@ static int gemini_rtc_probe(struct platform_device *pdev)
if (unlikely(ret))
return ret;
- rtc->rtc_dev = rtc_device_register(pdev->name, dev,
- &gemini_rtc_ops, THIS_MODULE);
+ rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &gemini_rtc_ops,
+ THIS_MODULE);
return PTR_ERR_OR_ZERO(rtc->rtc_dev);
}
-static int gemini_rtc_remove(struct platform_device *pdev)
-{
- struct gemini_rtc *rtc = platform_get_drvdata(pdev);
-
- rtc_device_unregister(rtc->rtc_dev);
-
- return 0;
-}
-
static struct platform_driver gemini_rtc_driver = {
.driver = {
.name = DRV_NAME,
},
.probe = gemini_rtc_probe,
- .remove = gemini_rtc_remove,
};
module_platform_driver_probe(gemini_rtc_driver, gemini_rtc_probe);
--
1.7.12.4
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 1/4] rtc: gemini: using devm_rtc_device_register helper
@ 2017-01-25 8:41 ` Kefeng Wang
0 siblings, 0 replies; 8+ messages in thread
From: Kefeng Wang @ 2017-01-25 8:41 UTC (permalink / raw)
To: linux-arm-kernel
Using devm_rtc_device_register() helper to simplify code.
Cc: Hans Ulli Kroll <ulli.kroll@googlemail.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/rtc/rtc-gemini.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-gemini.c b/drivers/rtc/rtc-gemini.c
index 688debc..504b6c1 100644
--- a/drivers/rtc/rtc-gemini.c
+++ b/drivers/rtc/rtc-gemini.c
@@ -145,26 +145,16 @@ static int gemini_rtc_probe(struct platform_device *pdev)
if (unlikely(ret))
return ret;
- rtc->rtc_dev = rtc_device_register(pdev->name, dev,
- &gemini_rtc_ops, THIS_MODULE);
+ rtc->rtc_dev = devm_rtc_device_register(dev, pdev->name, &gemini_rtc_ops,
+ THIS_MODULE);
return PTR_ERR_OR_ZERO(rtc->rtc_dev);
}
-static int gemini_rtc_remove(struct platform_device *pdev)
-{
- struct gemini_rtc *rtc = platform_get_drvdata(pdev);
-
- rtc_device_unregister(rtc->rtc_dev);
-
- return 0;
-}
-
static struct platform_driver gemini_rtc_driver = {
.driver = {
.name = DRV_NAME,
},
.probe = gemini_rtc_probe,
- .remove = gemini_rtc_remove,
};
module_platform_driver_probe(gemini_rtc_driver, gemini_rtc_probe);
--
1.7.12.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [rtc-linux] [PATCH 2/4] rtc: st-lpc: using devm_rtc_device_register helper
2017-01-25 8:41 ` Kefeng Wang
@ 2017-01-25 8:41 ` Kefeng Wang
-1 siblings, 0 replies; 8+ messages in thread
From: Kefeng Wang @ 2017-01-25 8:41 UTC (permalink / raw)
To: Hans Ulli Kroll, Alessandro Zummo, Alexandre Belloni,
Patrice Chotard, Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel,
rtc-linux
Cc: Kefeng Wang
Using devm_rtc_device_register() helper to simplify code.
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/rtc/rtc-st-lpc.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
index 74c0a33..4f81124 100644
--- a/drivers/rtc/rtc-st-lpc.c
+++ b/drivers/rtc/rtc-st-lpc.c
@@ -272,8 +272,8 @@ static int st_rtc_probe(struct platform_device *pdev)
st_rtc_set_time(&pdev->dev, &tm_check);
}
- rtc->rtc_dev = rtc_device_register("st-lpc-rtc", &pdev->dev,
- &st_rtc_ops, THIS_MODULE);
+ rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "st-lpc-rtc",
+ &st_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc->rtc_dev)) {
clk_disable_unprepare(rtc->clk);
return PTR_ERR(rtc->rtc_dev);
@@ -282,16 +282,6 @@ static int st_rtc_probe(struct platform_device *pdev)
return 0;
}
-static int st_rtc_remove(struct platform_device *pdev)
-{
- struct st_rtc *rtc = platform_get_drvdata(pdev);
-
- if (likely(rtc->rtc_dev))
- rtc_device_unregister(rtc->rtc_dev);
-
- return 0;
-}
-
#ifdef CONFIG_PM_SLEEP
static int st_rtc_suspend(struct device *dev)
{
@@ -344,7 +334,6 @@ static int st_rtc_resume(struct device *dev)
.of_match_table = st_rtc_match,
},
.probe = st_rtc_probe,
- .remove = st_rtc_remove,
};
module_platform_driver(st_rtc_platform_driver);
--
1.7.12.4
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 2/4] rtc: st-lpc: using devm_rtc_device_register helper
@ 2017-01-25 8:41 ` Kefeng Wang
0 siblings, 0 replies; 8+ messages in thread
From: Kefeng Wang @ 2017-01-25 8:41 UTC (permalink / raw)
To: linux-arm-kernel
Using devm_rtc_device_register() helper to simplify code.
Cc: Patrice Chotard <patrice.chotard@st.com>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/rtc/rtc-st-lpc.c | 15 ++-------------
1 file changed, 2 insertions(+), 13 deletions(-)
diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c
index 74c0a33..4f81124 100644
--- a/drivers/rtc/rtc-st-lpc.c
+++ b/drivers/rtc/rtc-st-lpc.c
@@ -272,8 +272,8 @@ static int st_rtc_probe(struct platform_device *pdev)
st_rtc_set_time(&pdev->dev, &tm_check);
}
- rtc->rtc_dev = rtc_device_register("st-lpc-rtc", &pdev->dev,
- &st_rtc_ops, THIS_MODULE);
+ rtc->rtc_dev = devm_rtc_device_register(&pdev->dev, "st-lpc-rtc",
+ &st_rtc_ops, THIS_MODULE);
if (IS_ERR(rtc->rtc_dev)) {
clk_disable_unprepare(rtc->clk);
return PTR_ERR(rtc->rtc_dev);
@@ -282,16 +282,6 @@ static int st_rtc_probe(struct platform_device *pdev)
return 0;
}
-static int st_rtc_remove(struct platform_device *pdev)
-{
- struct st_rtc *rtc = platform_get_drvdata(pdev);
-
- if (likely(rtc->rtc_dev))
- rtc_device_unregister(rtc->rtc_dev);
-
- return 0;
-}
-
#ifdef CONFIG_PM_SLEEP
static int st_rtc_suspend(struct device *dev)
{
@@ -344,7 +334,6 @@ static int st_rtc_resume(struct device *dev)
.of_match_table = st_rtc_match,
},
.probe = st_rtc_probe,
- .remove = st_rtc_remove,
};
module_platform_driver(st_rtc_platform_driver);
--
1.7.12.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [rtc-linux] [PATCH 3/4] rtc: sun6i: using devm_rtc_device_register helper
2017-01-25 8:41 ` Kefeng Wang
@ 2017-01-25 8:41 ` Kefeng Wang
-1 siblings, 0 replies; 8+ messages in thread
From: Kefeng Wang @ 2017-01-25 8:41 UTC (permalink / raw)
To: Hans Ulli Kroll, Alessandro Zummo, Alexandre Belloni,
Patrice Chotard, Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel,
rtc-linux
Cc: Kefeng Wang
Using devm_rtc_device_register() helper to simplify code.
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/rtc/rtc-sun6i.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index c169a2c..b22d5eb 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -404,8 +404,8 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
/* disable alarm wakeup */
writel(0, chip->base + SUN6I_ALARM_CONFIG);
- chip->rtc = rtc_device_register("rtc-sun6i", &pdev->dev,
- &sun6i_rtc_ops, THIS_MODULE);
+ chip->rtc = devm_rtc_device_register(&pdev->dev, "rtc-sun6i",
+ &sun6i_rtc_ops, THIS_MODULE);
if (IS_ERR(chip->rtc)) {
dev_err(&pdev->dev, "unable to register device\n");
return PTR_ERR(chip->rtc);
@@ -416,15 +416,6 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
return 0;
}
-static int sun6i_rtc_remove(struct platform_device *pdev)
-{
- struct sun6i_rtc_dev *chip = platform_get_drvdata(pdev);
-
- rtc_device_unregister(chip->rtc);
-
- return 0;
-}
-
static const struct of_device_id sun6i_rtc_dt_ids[] = {
{ .compatible = "allwinner,sun6i-a31-rtc" },
{ /* sentinel */ },
@@ -433,7 +424,6 @@ static int sun6i_rtc_remove(struct platform_device *pdev)
static struct platform_driver sun6i_rtc_driver = {
.probe = sun6i_rtc_probe,
- .remove = sun6i_rtc_remove,
.driver = {
.name = "sun6i-rtc",
.of_match_table = sun6i_rtc_dt_ids,
--
1.7.12.4
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 3/4] rtc: sun6i: using devm_rtc_device_register helper
@ 2017-01-25 8:41 ` Kefeng Wang
0 siblings, 0 replies; 8+ messages in thread
From: Kefeng Wang @ 2017-01-25 8:41 UTC (permalink / raw)
To: linux-arm-kernel
Using devm_rtc_device_register() helper to simplify code.
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/rtc/rtc-sun6i.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc/rtc-sun6i.c
index c169a2c..b22d5eb 100644
--- a/drivers/rtc/rtc-sun6i.c
+++ b/drivers/rtc/rtc-sun6i.c
@@ -404,8 +404,8 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
/* disable alarm wakeup */
writel(0, chip->base + SUN6I_ALARM_CONFIG);
- chip->rtc = rtc_device_register("rtc-sun6i", &pdev->dev,
- &sun6i_rtc_ops, THIS_MODULE);
+ chip->rtc = devm_rtc_device_register(&pdev->dev, "rtc-sun6i",
+ &sun6i_rtc_ops, THIS_MODULE);
if (IS_ERR(chip->rtc)) {
dev_err(&pdev->dev, "unable to register device\n");
return PTR_ERR(chip->rtc);
@@ -416,15 +416,6 @@ static int sun6i_rtc_probe(struct platform_device *pdev)
return 0;
}
-static int sun6i_rtc_remove(struct platform_device *pdev)
-{
- struct sun6i_rtc_dev *chip = platform_get_drvdata(pdev);
-
- rtc_device_unregister(chip->rtc);
-
- return 0;
-}
-
static const struct of_device_id sun6i_rtc_dt_ids[] = {
{ .compatible = "allwinner,sun6i-a31-rtc" },
{ /* sentinel */ },
@@ -433,7 +424,6 @@ static int sun6i_rtc_remove(struct platform_device *pdev)
static struct platform_driver sun6i_rtc_driver = {
.probe = sun6i_rtc_probe,
- .remove = sun6i_rtc_remove,
.driver = {
.name = "sun6i-rtc",
.of_match_table = sun6i_rtc_dt_ids,
--
1.7.12.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [rtc-linux] [PATCH 4/4] rtc: sunxi: using devm_rtc_device_register helper
2017-01-25 8:41 ` Kefeng Wang
@ 2017-01-25 8:41 ` Kefeng Wang
-1 siblings, 0 replies; 8+ messages in thread
From: Kefeng Wang @ 2017-01-25 8:41 UTC (permalink / raw)
To: Hans Ulli Kroll, Alessandro Zummo, Alexandre Belloni,
Patrice Chotard, Maxime Ripard, Chen-Yu Tsai, linux-arm-kernel,
rtc-linux
Cc: Kefeng Wang
Using devm_rtc_device_register() helper to simplify code.
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/rtc/rtc-sunxi.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c
index abada60..6fba5ae 100644
--- a/drivers/rtc/rtc-sunxi.c
+++ b/drivers/rtc/rtc-sunxi.c
@@ -481,8 +481,8 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
writel(SUNXI_ALRM_IRQ_STA_CNT_IRQ_PEND, chip->base +
SUNXI_ALRM_IRQ_STA);
- chip->rtc = rtc_device_register("rtc-sunxi", &pdev->dev,
- &sunxi_rtc_ops, THIS_MODULE);
+ chip->rtc = devm_rtc_device_register(&pdev->dev, "rtc-sunxi",
+ &sunxi_rtc_ops, THIS_MODULE);
if (IS_ERR(chip->rtc)) {
dev_err(&pdev->dev, "unable to register device\n");
return PTR_ERR(chip->rtc);
@@ -493,18 +493,8 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
return 0;
}
-static int sunxi_rtc_remove(struct platform_device *pdev)
-{
- struct sunxi_rtc_dev *chip = platform_get_drvdata(pdev);
-
- rtc_device_unregister(chip->rtc);
-
- return 0;
-}
-
static struct platform_driver sunxi_rtc_driver = {
.probe = sunxi_rtc_probe,
- .remove = sunxi_rtc_remove,
.driver = {
.name = "sunxi-rtc",
.of_match_table = sunxi_rtc_dt_ids,
--
1.7.12.4
--
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
---
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
^ permalink raw reply related [flat|nested] 8+ messages in thread
* [PATCH 4/4] rtc: sunxi: using devm_rtc_device_register helper
@ 2017-01-25 8:41 ` Kefeng Wang
0 siblings, 0 replies; 8+ messages in thread
From: Kefeng Wang @ 2017-01-25 8:41 UTC (permalink / raw)
To: linux-arm-kernel
Using devm_rtc_device_register() helper to simplify code.
Cc: Alessandro Zummo <a.zummo@towertech.it>
Cc: Alexandre Belloni <alexandre.belloni@free-electrons.com>
Cc: Maxime Ripard <maxime.ripard@free-electrons.com>
Cc: Chen-Yu Tsai <wens@csie.org>
Signed-off-by: Kefeng Wang <wangkefeng.wang@huawei.com>
---
drivers/rtc/rtc-sunxi.c | 14 ++------------
1 file changed, 2 insertions(+), 12 deletions(-)
diff --git a/drivers/rtc/rtc-sunxi.c b/drivers/rtc/rtc-sunxi.c
index abada60..6fba5ae 100644
--- a/drivers/rtc/rtc-sunxi.c
+++ b/drivers/rtc/rtc-sunxi.c
@@ -481,8 +481,8 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
writel(SUNXI_ALRM_IRQ_STA_CNT_IRQ_PEND, chip->base +
SUNXI_ALRM_IRQ_STA);
- chip->rtc = rtc_device_register("rtc-sunxi", &pdev->dev,
- &sunxi_rtc_ops, THIS_MODULE);
+ chip->rtc = devm_rtc_device_register(&pdev->dev, "rtc-sunxi",
+ &sunxi_rtc_ops, THIS_MODULE);
if (IS_ERR(chip->rtc)) {
dev_err(&pdev->dev, "unable to register device\n");
return PTR_ERR(chip->rtc);
@@ -493,18 +493,8 @@ static int sunxi_rtc_probe(struct platform_device *pdev)
return 0;
}
-static int sunxi_rtc_remove(struct platform_device *pdev)
-{
- struct sunxi_rtc_dev *chip = platform_get_drvdata(pdev);
-
- rtc_device_unregister(chip->rtc);
-
- return 0;
-}
-
static struct platform_driver sunxi_rtc_driver = {
.probe = sunxi_rtc_probe,
- .remove = sunxi_rtc_remove,
.driver = {
.name = "sunxi-rtc",
.of_match_table = sunxi_rtc_dt_ids,
--
1.7.12.4
^ permalink raw reply related [flat|nested] 8+ messages in thread
end of thread, other threads:[~2017-01-25 8:47 UTC | newest]
Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-25 8:41 [rtc-linux] [PATCH 1/4] rtc: gemini: using devm_rtc_device_register helper Kefeng Wang
2017-01-25 8:41 ` Kefeng Wang
2017-01-25 8:41 ` [rtc-linux] [PATCH 2/4] rtc: st-lpc: " Kefeng Wang
2017-01-25 8:41 ` Kefeng Wang
2017-01-25 8:41 ` [rtc-linux] [PATCH 3/4] rtc: sun6i: " Kefeng Wang
2017-01-25 8:41 ` Kefeng Wang
2017-01-25 8:41 ` [rtc-linux] [PATCH 4/4] rtc: sunxi: " Kefeng Wang
2017-01-25 8:41 ` Kefeng Wang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.