* [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id
@ 2012-07-07 20:47 Fabio Estevam
2012-07-07 20:47 ` [PATCH 2/3] rtc: rtc-mxc: Adapt to the new i.mx clock framework Fabio Estevam
` (3 more replies)
0 siblings, 4 replies; 6+ messages in thread
From: Fabio Estevam @ 2012-07-07 20:47 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@freescale.com>
Fix rtc clock id.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
arch/arm/mach-imx/clk-imx27.c | 2 +-
arch/arm/mach-imx/clk-imx31.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
index 295cbd7..167a3f1 100644
--- a/arch/arm/mach-imx/clk-imx27.c
+++ b/arch/arm/mach-imx/clk-imx27.c
@@ -256,7 +256,7 @@ int __init mx27_clocks_init(unsigned long fref)
clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL);
clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL);
clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL);
- clk_register_clkdev(clk[rtc_ipg_gate], "rtc", NULL);
+ clk_register_clkdev(clk[rtc_ipg_gate], NULL, "mxc_rtc");
clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL);
clk_register_clkdev(clk[cpu_div], "cpu", NULL);
clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL);
diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
index c9a06d8..8711090 100644
--- a/arch/arm/mach-imx/clk-imx31.c
+++ b/arch/arm/mach-imx/clk-imx31.c
@@ -123,7 +123,7 @@ int __init mx31_clocks_init(unsigned long fref)
clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
- clk_register_clkdev(clk[rtc_gate], "rtc", NULL);
+ clk_register_clkdev(clk[rtc_gate], NULL, "mxc_rtc");
clk_register_clkdev(clk[epit1_gate], "epit", NULL);
clk_register_clkdev(clk[epit2_gate], "epit", NULL);
clk_register_clkdev(clk[nfc], NULL, "mxc_nand.0");
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] rtc: rtc-mxc: Adapt to the new i.mx clock framework
2012-07-07 20:47 [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id Fabio Estevam
@ 2012-07-07 20:47 ` Fabio Estevam
2012-07-09 6:50 ` Sascha Hauer
2012-07-07 20:47 ` [PATCH 3/3] rtc: rtc-mxc: Convert to module_platform_driver Fabio Estevam
` (2 subsequent siblings)
3 siblings, 1 reply; 6+ messages in thread
From: Fabio Estevam @ 2012-07-07 20:47 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/rtc/rtc-mxc.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index e3e50d6..5d8456a 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -367,14 +367,14 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
pdata->ioaddr = devm_ioremap(&pdev->dev, res->start,
resource_size(res));
- pdata->clk = clk_get(&pdev->dev, "rtc");
+ pdata->clk = clk_get(&pdev->dev, NULL);
if (IS_ERR(pdata->clk)) {
dev_err(&pdev->dev, "unable to get clock!\n");
ret = PTR_ERR(pdata->clk);
goto exit_free_pdata;
}
- clk_enable(pdata->clk);
+ clk_prepare_enable(pdata->clk);
rate = clk_get_rate(pdata->clk);
if (rate == 32768)
@@ -426,7 +426,7 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
exit_clr_drvdata:
platform_set_drvdata(pdev, NULL);
exit_put_clk:
- clk_disable(pdata->clk);
+ clk_disable_unprepare(pdata->clk);
clk_put(pdata->clk);
exit_free_pdata:
@@ -440,7 +440,7 @@ static int __exit mxc_rtc_remove(struct platform_device *pdev)
rtc_device_unregister(pdata->rtc);
- clk_disable(pdata->clk);
+ clk_disable_unprepare(pdata->clk);
clk_put(pdata->clk);
platform_set_drvdata(pdev, NULL);
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/3] rtc: rtc-mxc: Convert to module_platform_driver
2012-07-07 20:47 [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id Fabio Estevam
2012-07-07 20:47 ` [PATCH 2/3] rtc: rtc-mxc: Adapt to the new i.mx clock framework Fabio Estevam
@ 2012-07-07 20:47 ` Fabio Estevam
2012-07-09 6:51 ` [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id Sascha Hauer
2012-07-09 21:18 ` Andrew Morton
3 siblings, 0 replies; 6+ messages in thread
From: Fabio Estevam @ 2012-07-07 20:47 UTC (permalink / raw)
To: linux-arm-kernel
From: Fabio Estevam <fabio.estevam@freescale.com>
Converting to module_platform_driver can make the code smaller and cleaner.
Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
drivers/rtc/rtc-mxc.c | 20 +++++---------------
1 files changed, 5 insertions(+), 15 deletions(-)
diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
index 5d8456a..33d6e27 100644
--- a/drivers/rtc/rtc-mxc.c
+++ b/drivers/rtc/rtc-mxc.c
@@ -343,7 +343,7 @@ static struct rtc_class_ops mxc_rtc_ops = {
.alarm_irq_enable = mxc_rtc_alarm_irq_enable,
};
-static int __init mxc_rtc_probe(struct platform_device *pdev)
+static int __devinit mxc_rtc_probe(struct platform_device *pdev)
{
struct resource *res;
struct rtc_device *rtc;
@@ -434,7 +434,7 @@ exit_free_pdata:
return ret;
}
-static int __exit mxc_rtc_remove(struct platform_device *pdev)
+static int __devexit mxc_rtc_remove(struct platform_device *pdev)
{
struct rtc_plat_data *pdata = platform_get_drvdata(pdev);
@@ -482,21 +482,11 @@ static struct platform_driver mxc_rtc_driver = {
#endif
.owner = THIS_MODULE,
},
- .remove = __exit_p(mxc_rtc_remove),
+ .probe = mxc_rtc_probe,
+ .remove = __devexit_p(mxc_rtc_remove),
};
-static int __init mxc_rtc_init(void)
-{
- return platform_driver_probe(&mxc_rtc_driver, mxc_rtc_probe);
-}
-
-static void __exit mxc_rtc_exit(void)
-{
- platform_driver_unregister(&mxc_rtc_driver);
-}
-
-module_init(mxc_rtc_init);
-module_exit(mxc_rtc_exit);
+module_platform_driver(mxc_rtc_driver);
MODULE_AUTHOR("Daniel Mack <daniel@caiaq.de>");
MODULE_DESCRIPTION("RTC driver for Freescale MXC");
--
1.7.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/3] rtc: rtc-mxc: Adapt to the new i.mx clock framework
2012-07-07 20:47 ` [PATCH 2/3] rtc: rtc-mxc: Adapt to the new i.mx clock framework Fabio Estevam
@ 2012-07-09 6:50 ` Sascha Hauer
0 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2012-07-09 6:50 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jul 07, 2012 at 05:47:20PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
> drivers/rtc/rtc-mxc.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/rtc/rtc-mxc.c b/drivers/rtc/rtc-mxc.c
> index e3e50d6..5d8456a 100644
> --- a/drivers/rtc/rtc-mxc.c
> +++ b/drivers/rtc/rtc-mxc.c
> @@ -367,14 +367,14 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
> pdata->ioaddr = devm_ioremap(&pdev->dev, res->start,
> resource_size(res));
>
> - pdata->clk = clk_get(&pdev->dev, "rtc");
> + pdata->clk = clk_get(&pdev->dev, NULL);
Since the rest of the driver already uses devm_, why not do it here
aswell?
Sascha
> if (IS_ERR(pdata->clk)) {
> dev_err(&pdev->dev, "unable to get clock!\n");
> ret = PTR_ERR(pdata->clk);
> goto exit_free_pdata;
> }
>
> - clk_enable(pdata->clk);
> + clk_prepare_enable(pdata->clk);
> rate = clk_get_rate(pdata->clk);
>
> if (rate == 32768)
> @@ -426,7 +426,7 @@ static int __init mxc_rtc_probe(struct platform_device *pdev)
> exit_clr_drvdata:
> platform_set_drvdata(pdev, NULL);
> exit_put_clk:
> - clk_disable(pdata->clk);
> + clk_disable_unprepare(pdata->clk);
> clk_put(pdata->clk);
>
> exit_free_pdata:
> @@ -440,7 +440,7 @@ static int __exit mxc_rtc_remove(struct platform_device *pdev)
>
> rtc_device_unregister(pdata->rtc);
>
> - clk_disable(pdata->clk);
> + clk_disable_unprepare(pdata->clk);
> clk_put(pdata->clk);
> platform_set_drvdata(pdev, NULL);
>
> --
> 1.7.1
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id
2012-07-07 20:47 [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id Fabio Estevam
2012-07-07 20:47 ` [PATCH 2/3] rtc: rtc-mxc: Adapt to the new i.mx clock framework Fabio Estevam
2012-07-07 20:47 ` [PATCH 3/3] rtc: rtc-mxc: Convert to module_platform_driver Fabio Estevam
@ 2012-07-09 6:51 ` Sascha Hauer
2012-07-09 21:18 ` Andrew Morton
3 siblings, 0 replies; 6+ messages in thread
From: Sascha Hauer @ 2012-07-09 6:51 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, Jul 07, 2012 at 05:47:19PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
>
> Fix rtc clock id.
>
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
Applied this patch.
Sascha
> ---
> arch/arm/mach-imx/clk-imx27.c | 2 +-
> arch/arm/mach-imx/clk-imx31.c | 2 +-
> 2 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/arch/arm/mach-imx/clk-imx27.c b/arch/arm/mach-imx/clk-imx27.c
> index 295cbd7..167a3f1 100644
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -256,7 +256,7 @@ int __init mx27_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL);
> clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL);
> clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL);
> - clk_register_clkdev(clk[rtc_ipg_gate], "rtc", NULL);
> + clk_register_clkdev(clk[rtc_ipg_gate], NULL, "mxc_rtc");
> clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL);
> clk_register_clkdev(clk[cpu_div], "cpu", NULL);
> clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL);
> diff --git a/arch/arm/mach-imx/clk-imx31.c b/arch/arm/mach-imx/clk-imx31.c
> index c9a06d8..8711090 100644
> --- a/arch/arm/mach-imx/clk-imx31.c
> +++ b/arch/arm/mach-imx/clk-imx31.c
> @@ -123,7 +123,7 @@ int __init mx31_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[cspi3_gate], NULL, "imx31-cspi.2");
> clk_register_clkdev(clk[pwm_gate], "pwm", NULL);
> clk_register_clkdev(clk[wdog_gate], NULL, "imx2-wdt.0");
> - clk_register_clkdev(clk[rtc_gate], "rtc", NULL);
> + clk_register_clkdev(clk[rtc_gate], NULL, "mxc_rtc");
> clk_register_clkdev(clk[epit1_gate], "epit", NULL);
> clk_register_clkdev(clk[epit2_gate], "epit", NULL);
> clk_register_clkdev(clk[nfc], NULL, "mxc_nand.0");
> --
> 1.7.1
>
>
--
Pengutronix e.K. | |
Industrial Linux Solutions | http://www.pengutronix.de/ |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id
2012-07-07 20:47 [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id Fabio Estevam
` (2 preceding siblings ...)
2012-07-09 6:51 ` [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id Sascha Hauer
@ 2012-07-09 21:18 ` Andrew Morton
3 siblings, 0 replies; 6+ messages in thread
From: Andrew Morton @ 2012-07-09 21:18 UTC (permalink / raw)
To: linux-arm-kernel
On Sat, 7 Jul 2012 17:47:19 -0300
Fabio Estevam <festevam@gmail.com> wrote:
> Fix rtc clock id.
>
> --- a/arch/arm/mach-imx/clk-imx27.c
> +++ b/arch/arm/mach-imx/clk-imx27.c
> @@ -256,7 +256,7 @@ int __init mx27_clocks_init(unsigned long fref)
> clk_register_clkdev(clk[gpio_ipg_gate], "gpio", NULL);
> clk_register_clkdev(clk[brom_ahb_gate], "brom", NULL);
> clk_register_clkdev(clk[ata_ahb_gate], "ata", NULL);
> - clk_register_clkdev(clk[rtc_ipg_gate], "rtc", NULL);
> + clk_register_clkdev(clk[rtc_ipg_gate], NULL, "mxc_rtc");
> clk_register_clkdev(clk[scc_ipg_gate], "scc", NULL);
> clk_register_clkdev(clk[cpu_div], "cpu", NULL);
> clk_register_clkdev(clk[emi_ahb_gate], "emi_ahb" , NULL);
When I look at this patch I don't know if it changes the user interface
(does it rename or move sysfs files or contents?) and I don't know
whether the patch fixes serious issues, which would indicate that a
backport into -stable is needed.
So, please read and remember these words: when fixing a bug, always
provide a complete description of that bug. Most especially, provide a
description of the end-user effects of the bug.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-07-09 21:18 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-07 20:47 [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id Fabio Estevam
2012-07-07 20:47 ` [PATCH 2/3] rtc: rtc-mxc: Adapt to the new i.mx clock framework Fabio Estevam
2012-07-09 6:50 ` Sascha Hauer
2012-07-07 20:47 ` [PATCH 3/3] rtc: rtc-mxc: Convert to module_platform_driver Fabio Estevam
2012-07-09 6:51 ` [PATCH 1/3] ARM: clk-imx27: Fix rtc clock id Sascha Hauer
2012-07-09 21:18 ` Andrew Morton
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).