With the new i.mx clock framework the mxc_w1 clock is registered as:
clk_register_clkdev(clk[owire_gate], NULL, "mxc_w1.0");
So we do not need to pass "owire" string and can use NULL instead.
While at it, also fix the clock error handling code.
Acked-by: Sascha Hauer <[email protected]>
Acked-by: Evgeniy Polyakov <[email protected]>
Signed-off-by: Fabio Estevam <[email protected]>
-----
Changes since v2:
- Add Ack's
Changes since v1:
- Fix clock error handling
drivers/w1/masters/mxc_w1.c | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
index 1cc61a7..960b362 100644
--- a/drivers/w1/masters/mxc_w1.c
+++ b/drivers/w1/masters/mxc_w1.c
@@ -117,11 +117,11 @@ static int __devinit mxc_w1_probe(struct platform_device *pdev)
if (!mdev)
return -ENOMEM;
- mdev->clk = clk_get(&pdev->dev, "owire");
- if (!mdev->clk) {
- err = -ENODEV;
- goto failed_clk;
- }
+ mdev->clk = clk_get(&pdev->dev, NULL);
+ if (IS_ERR(mdev->clk)) {
+ err = PTR_ERR(mdev->clk);
+ goto failed_clk;
+ }
mdev->clkdiv = (clk_get_rate(mdev->clk) / 1000000) - 1;
--
1.7.9.5
We are dealing with mxc_w1 registers.
While at it use dev_err() instead.
Signed-off-by: Fabio Estevam <[email protected]>
---
Changes since v2:
- No changes
drivers/w1/masters/mxc_w1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
index 14f0f66..25b234c 100644
--- a/drivers/w1/masters/mxc_w1.c
+++ b/drivers/w1/masters/mxc_w1.c
@@ -134,7 +134,7 @@ static int __devinit mxc_w1_probe(struct platform_device *pdev)
mdev->regs = ioremap(res->start, resource_size(res));
if (!mdev->regs) {
- printk(KERN_ERR "Cannot map frame buffer registers\n");
+ dev_err(&pdev->dev, "Cannot map mxc_w1 registers\n");
goto failed_ioremap;
}
--
1.7.9.5
Using module_platform_driver() makes the code smaller and cleaner.
Signed-off-by: Fabio Estevam <[email protected]>
---
Changes since v2:
- No changes
drivers/w1/masters/mxc_w1.c | 16 ++--------------
1 file changed, 2 insertions(+), 14 deletions(-)
diff --git a/drivers/w1/masters/mxc_w1.c b/drivers/w1/masters/mxc_w1.c
index 25b234c..a06514b 100644
--- a/drivers/w1/masters/mxc_w1.c
+++ b/drivers/w1/masters/mxc_w1.c
@@ -191,21 +191,9 @@ static struct platform_driver mxc_w1_driver = {
.name = "mxc_w1",
},
.probe = mxc_w1_probe,
- .remove = mxc_w1_remove,
+ .remove = __devexit_p(mxc_w1_remove),
};
-
-static int __init mxc_w1_init(void)
-{
- return platform_driver_register(&mxc_w1_driver);
-}
-
-static void mxc_w1_exit(void)
-{
- platform_driver_unregister(&mxc_w1_driver);
-}
-
-module_init(mxc_w1_init);
-module_exit(mxc_w1_exit);
+module_platform_driver(mxc_w1_driver);
MODULE_LICENSE("GPL");
MODULE_AUTHOR("Freescale Semiconductors Inc");
--
1.7.9.5