linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework
@ 2012-09-05 22:01 Fabio Estevam
  2012-09-05 22:01 ` [PATCH 2/3] w1: mxc_w1: Fix comment Fabio Estevam
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Fabio Estevam @ 2012-09-05 22:01 UTC (permalink / raw)
  To: zbr; +Cc: s.hauer, linux-kernel, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

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.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 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 1cc61a7..14f0f66 100644
--- a/drivers/w1/masters/mxc_w1.c
+++ b/drivers/w1/masters/mxc_w1.c
@@ -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;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 2/3] w1: mxc_w1: Fix comment
  2012-09-05 22:01 [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework Fabio Estevam
@ 2012-09-05 22:01 ` Fabio Estevam
  2012-09-05 22:01 ` [PATCH 3/3] w1: mxc_w1: Convert to platform driver Fabio Estevam
  2012-09-06  7:23 ` [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2012-09-05 22:01 UTC (permalink / raw)
  To: zbr; +Cc: s.hauer, linux-kernel, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

We are dealing with mxc_w1 registers.

While at it use dev_err() instead.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH 3/3] w1: mxc_w1: Convert to platform driver
  2012-09-05 22:01 [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework Fabio Estevam
  2012-09-05 22:01 ` [PATCH 2/3] w1: mxc_w1: Fix comment Fabio Estevam
@ 2012-09-05 22:01 ` Fabio Estevam
  2012-09-06  7:23 ` [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Fabio Estevam @ 2012-09-05 22:01 UTC (permalink / raw)
  To: zbr; +Cc: s.hauer, linux-kernel, Fabio Estevam

From: Fabio Estevam <fabio.estevam@freescale.com>

Using module_platform_driver() makes the code smaller and cleaner.

Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
---
 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


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework
  2012-09-05 22:01 [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework Fabio Estevam
  2012-09-05 22:01 ` [PATCH 2/3] w1: mxc_w1: Fix comment Fabio Estevam
  2012-09-05 22:01 ` [PATCH 3/3] w1: mxc_w1: Convert to platform driver Fabio Estevam
@ 2012-09-06  7:23 ` Sascha Hauer
  2 siblings, 0 replies; 4+ messages in thread
From: Sascha Hauer @ 2012-09-06  7:23 UTC (permalink / raw)
  To: Fabio Estevam; +Cc: zbr, linux-kernel, Fabio Estevam

Hi Fabio,

On Wed, Sep 05, 2012 at 07:01:18PM -0300, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@freescale.com>
> 
> 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.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@freescale.com>
> ---
>  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 1cc61a7..14f0f66 100644
> --- a/drivers/w1/masters/mxc_w1.c
> +++ b/drivers/w1/masters/mxc_w1.c
> @@ -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

-- 
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] 4+ messages in thread

end of thread, other threads:[~2012-09-06  7:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-05 22:01 [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework Fabio Estevam
2012-09-05 22:01 ` [PATCH 2/3] w1: mxc_w1: Fix comment Fabio Estevam
2012-09-05 22:01 ` [PATCH 3/3] w1: mxc_w1: Convert to platform driver Fabio Estevam
2012-09-06  7:23 ` [PATCH 1/3] w1: mxc_w1: Adapt the clock name to the new clock framework Sascha Hauer

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).