Skip to contentSkip to conversation

w1: mxc_w1: Adapt the clock name to the new clock framework

PATCH In review Fabio Estevam 2 participants 4 messages Sep 5, 2012 – Sep 6, 2012

Subsystems (2)
lore
Share & tools
lore

Fabio Estevam

author reviewer
#0 lore raw

PATCH 1/3 w1: mxc_w1: Adapt the clock name to the new clock framework

From: Fabio Estevam <[email protected]>

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.

---
 drivers/w1/masters/mxc_w1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/w1/masters/mxc_w1.c +1 -1
index 1cc61a7..14f0f66 100644
@@ -117,7 +117,7 @@ static int __devinit mxc_w1_probe(struct platform_device *pdev)
 	if (!mdev)
 		return -ENOMEM;
 
-	mdev->clk = clk_get(&pdev->dev, "owire");
+	mdev->clk = clk_get(&pdev->dev, NULL);
 	if (!mdev->clk) {
 		err = -ENODEV;
 		goto failed_clk;
Signature · 1 line
1.7.9.5
author reviewer
#1 lore raw

PATCH 2/3 w1: mxc_w1: Fix comment

From: Fabio Estevam <[email protected]>

We are dealing with mxc_w1 registers.

While at it use dev_err() instead.

---
 drivers/w1/masters/mxc_w1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/w1/masters/mxc_w1.c +1 -1
index 14f0f66..25b234c 100644
@@ -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;
 	}
 
Signature · 1 line
1.7.9.5
author reviewer
#2 lore raw

PATCH 3/3 w1: mxc_w1: Convert to platform driver

In reply to Fabio Estevam

From: Fabio Estevam <[email protected]>

Using module_platform_driver() makes the code smaller and cleaner.

---
 drivers/w1/masters/mxc_w1.c |   16 ++--------------
 1 file changed, 2 insertions(+), 14 deletions(-)
drivers/w1/masters/mxc_w1.c +2 -14
index 25b234c..a06514b 100644
@@ -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");
Signature · 1 line
1.7.9.5
maintainer
#3 lore raw
In reply to Fabio Estevam

Hi Fabio,

Quoted 18 lines · Fabio Estevam

From: Fabio Estevam <[email protected]>

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.

---
 drivers/w1/masters/mxc_w1.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/w1/masters/mxc_w1.c +0 -0
index 1cc61a7..14f0f66 100644

drivers/w1/masters/mxc_w1.c static int __devinit mxc_w1_probe(struct platform_device *pdev) · line 121

Quoted 6 lines
drivers/w1/masters/mxc_w1.c +1 -1
@@ -117,7 +117,7 @@ static int __devinit mxc_w1_probe(struct platform_device *pdev)
 	if (!mdev)
 		return -ENOMEM;
 
-	mdev->clk = clk_get(&pdev->dev, "owire");
+	mdev->clk = clk_get(&pdev->dev, NULL);
 	if (!mdev->clk) {

You can sell this patch better if you fix the wrong error check here and 'by the way' adjust the lookup string.

Sascha

Signature · 4 lines
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 |