linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/6] w1: omap-hdq: add section annotation to remove
@ 2012-07-25 12:05 Felipe Balbi
  2012-07-25 12:05 ` [PATCH 2/6] w1: omap-hdq: don't hardcode resource size Felipe Balbi
                   ` (5 more replies)
  0 siblings, 6 replies; 10+ messages in thread
From: Felipe Balbi @ 2012-07-25 12:05 UTC (permalink / raw)
  To: zbr; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, Felipe Balbi

trivial patch, no functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/w1/masters/omap_hdq.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 291897c..46e1f6f 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -73,11 +73,11 @@ struct hdq_data {
 };
 
 static int __devinit omap_hdq_probe(struct platform_device *pdev);
-static int omap_hdq_remove(struct platform_device *pdev);
+static int __devexit omap_hdq_remove(struct platform_device *pdev);
 
 static struct platform_driver omap_hdq_driver = {
 	.probe =	omap_hdq_probe,
-	.remove =	omap_hdq_remove,
+	.remove =	__devexit_p(omap_hdq_remove),
 	.driver =	{
 		.name =	"omap_hdq",
 	},
@@ -630,7 +630,7 @@ err_kmalloc:
 
 }
 
-static int omap_hdq_remove(struct platform_device *pdev)
+static int __devexit omap_hdq_remove(struct platform_device *pdev)
 {
 	struct hdq_data *hdq_data = platform_get_drvdata(pdev);
 
-- 
1.7.11


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

* [PATCH 2/6] w1: omap-hdq: don't hardcode resource size
  2012-07-25 12:05 [PATCH 1/6] w1: omap-hdq: add section annotation to remove Felipe Balbi
@ 2012-07-25 12:05 ` Felipe Balbi
  2012-07-25 12:05 ` [PATCH 3/6] w1: omap-hdq: convert to module_platform_driver Felipe Balbi
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Felipe Balbi @ 2012-07-25 12:05 UTC (permalink / raw)
  To: zbr; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, Felipe Balbi

we have the helpful resource_size() macro to
calculate the size of the memory resource for
us, let's use it.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/w1/masters/omap_hdq.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 46e1f6f..404a4de 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -568,7 +568,7 @@ static int __devinit omap_hdq_probe(struct platform_device *pdev)
 		goto err_resource;
 	}
 
-	hdq_data->hdq_base = ioremap(res->start, SZ_4K);
+	hdq_data->hdq_base = ioremap(res->start, resource_size(res));
 	if (!hdq_data->hdq_base) {
 		dev_dbg(&pdev->dev, "ioremap failed\n");
 		ret = -EINVAL;
-- 
1.7.11

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

* [PATCH 3/6] w1: omap-hdq: convert to module_platform_driver
  2012-07-25 12:05 [PATCH 1/6] w1: omap-hdq: add section annotation to remove Felipe Balbi
  2012-07-25 12:05 ` [PATCH 2/6] w1: omap-hdq: don't hardcode resource size Felipe Balbi
@ 2012-07-25 12:05 ` Felipe Balbi
  2012-07-25 12:05 ` [PATCH 4/6] w1: omap-hdq: convert to devm_* functions Felipe Balbi
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Felipe Balbi @ 2012-07-25 12:05 UTC (permalink / raw)
  To: zbr; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, Felipe Balbi

trivial patch, no functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/w1/masters/omap_hdq.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 404a4de..1ebddcf 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -654,19 +654,7 @@ static int __devexit omap_hdq_remove(struct platform_device *pdev)
 	return 0;
 }
 
-static int __init
-omap_hdq_init(void)
-{
-	return platform_driver_register(&omap_hdq_driver);
-}
-module_init(omap_hdq_init);
-
-static void __exit
-omap_hdq_exit(void)
-{
-	platform_driver_unregister(&omap_hdq_driver);
-}
-module_exit(omap_hdq_exit);
+module_platform_driver(omap_hdq_driver);
 
 module_param(w1_id, int, S_IRUSR);
 MODULE_PARM_DESC(w1_id, "1-wire id for the slave detection");
-- 
1.7.11


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

* [PATCH 4/6] w1: omap-hdq: convert to devm_* functions
  2012-07-25 12:05 [PATCH 1/6] w1: omap-hdq: add section annotation to remove Felipe Balbi
  2012-07-25 12:05 ` [PATCH 2/6] w1: omap-hdq: don't hardcode resource size Felipe Balbi
  2012-07-25 12:05 ` [PATCH 3/6] w1: omap-hdq: convert to module_platform_driver Felipe Balbi
@ 2012-07-25 12:05 ` Felipe Balbi
  2012-07-25 12:05 ` [PATCH 5/6] w1: omap-hdq: remove unnecessary return Felipe Balbi
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 10+ messages in thread
From: Felipe Balbi @ 2012-07-25 12:05 UTC (permalink / raw)
  To: zbr; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, Felipe Balbi

this lets us remove a bit of boilerplate code.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/w1/masters/omap_hdq.c | 32 +++++++++-----------------------
 1 file changed, 9 insertions(+), 23 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 1ebddcf..b6eb0ba 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -546,33 +546,31 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
 
 static int __devinit omap_hdq_probe(struct platform_device *pdev)
 {
+	struct device *dev = &pdev->dev;
 	struct hdq_data *hdq_data;
 	struct resource *res;
 	int ret, irq;
 	u8 rev;
 
-	hdq_data = kmalloc(sizeof(*hdq_data), GFP_KERNEL);
+	hdq_data = devm_kzalloc(dev, sizeof(*hdq_data), GFP_KERNEL);
 	if (!hdq_data) {
 		dev_dbg(&pdev->dev, "unable to allocate memory\n");
-		ret = -ENOMEM;
-		goto err_kmalloc;
+		return -ENOMEM;
 	}
 
-	hdq_data->dev = &pdev->dev;
+	hdq_data->dev = dev;
 	platform_set_drvdata(pdev, hdq_data);
 
 	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
 	if (!res) {
 		dev_dbg(&pdev->dev, "unable to get resource\n");
-		ret = -ENXIO;
-		goto err_resource;
+		return -ENXIO;
 	}
 
-	hdq_data->hdq_base = ioremap(res->start, resource_size(res));
+	hdq_data->hdq_base = devm_request_and_ioremap(dev, res);
 	if (!hdq_data->hdq_base) {
 		dev_dbg(&pdev->dev, "ioremap failed\n");
-		ret = -EINVAL;
-		goto err_ioremap;
+		return -ENOMEM;
 	}
 
 	hdq_data->hdq_usecount = 0;
@@ -593,7 +591,8 @@ static int __devinit omap_hdq_probe(struct platform_device *pdev)
 		goto err_irq;
 	}
 
-	ret = request_irq(irq, hdq_isr, IRQF_DISABLED, "omap_hdq", hdq_data);
+	ret = devm_request_irq(dev, irq, hdq_isr, IRQF_DISABLED,
+			"omap_hdq", hdq_data);
 	if (ret < 0) {
 		dev_dbg(&pdev->dev, "could not request irq\n");
 		goto err_irq;
@@ -618,16 +617,7 @@ err_irq:
 err_w1:
 	pm_runtime_disable(&pdev->dev);
 
-	iounmap(hdq_data->hdq_base);
-
-err_ioremap:
-err_resource:
-	platform_set_drvdata(pdev, NULL);
-	kfree(hdq_data);
-
-err_kmalloc:
 	return ret;
-
 }
 
 static int __devexit omap_hdq_remove(struct platform_device *pdev)
@@ -646,10 +636,6 @@ static int __devexit omap_hdq_remove(struct platform_device *pdev)
 
 	/* remove module dependency */
 	pm_runtime_disable(&pdev->dev);
-	free_irq(INT_24XX_HDQ_IRQ, hdq_data);
-	platform_set_drvdata(pdev, NULL);
-	iounmap(hdq_data->hdq_base);
-	kfree(hdq_data);
 
 	return 0;
 }
-- 
1.7.11

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

* [PATCH 5/6] w1: omap-hdq: remove unnecessary return
  2012-07-25 12:05 [PATCH 1/6] w1: omap-hdq: add section annotation to remove Felipe Balbi
                   ` (2 preceding siblings ...)
  2012-07-25 12:05 ` [PATCH 4/6] w1: omap-hdq: convert to devm_* functions Felipe Balbi
@ 2012-07-25 12:05 ` Felipe Balbi
  2012-07-25 12:05 ` [PATCH 6/6] w1: omap-hdq: drop ARCH dependency Felipe Balbi
  2012-07-26 14:45 ` [PATCH 1/6] w1: omap-hdq: add section annotation to remove Evgeniy Polyakov
  5 siblings, 0 replies; 10+ messages in thread
From: Felipe Balbi @ 2012-07-25 12:05 UTC (permalink / raw)
  To: zbr; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, Felipe Balbi

trivial patch, no functional changes.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/w1/masters/omap_hdq.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index b6eb0ba..778a65d 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -540,8 +540,6 @@ static void omap_w1_write_byte(void *_hdq, u8 byte)
 		hdq_data->init_trans = 0;
 		mutex_unlock(&hdq_data->hdq_mutex);
 	}
-
-	return;
 }
 
 static int __devinit omap_hdq_probe(struct platform_device *pdev)
-- 
1.7.11

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

* [PATCH 6/6] w1: omap-hdq: drop ARCH dependency
  2012-07-25 12:05 [PATCH 1/6] w1: omap-hdq: add section annotation to remove Felipe Balbi
                   ` (3 preceding siblings ...)
  2012-07-25 12:05 ` [PATCH 5/6] w1: omap-hdq: remove unnecessary return Felipe Balbi
@ 2012-07-25 12:05 ` Felipe Balbi
  2012-07-26 14:45 ` [PATCH 1/6] w1: omap-hdq: add section annotation to remove Evgeniy Polyakov
  5 siblings, 0 replies; 10+ messages in thread
From: Felipe Balbi @ 2012-07-25 12:05 UTC (permalink / raw)
  To: zbr; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, Felipe Balbi

Let the driver compile everywhere while
also removing unnecessary headers.

Signed-off-by: Felipe Balbi <balbi@ti.com>
---
 drivers/w1/masters/Kconfig    | 1 -
 drivers/w1/masters/omap_hdq.c | 3 ---
 2 files changed, 4 deletions(-)

diff --git a/drivers/w1/masters/Kconfig b/drivers/w1/masters/Kconfig
index 5ceb1cd..7e98403 100644
--- a/drivers/w1/masters/Kconfig
+++ b/drivers/w1/masters/Kconfig
@@ -60,7 +60,6 @@ config W1_MASTER_GPIO
 
 config HDQ_MASTER_OMAP
 	tristate "OMAP HDQ driver"
-	depends on ARCH_OMAP2PLUS
 	help
 	  Say Y here if you want support for the 1-wire or HDQ Interface
 	  on an OMAP processor.
diff --git a/drivers/w1/masters/omap_hdq.c b/drivers/w1/masters/omap_hdq.c
index 778a65d..771875d 100644
--- a/drivers/w1/masters/omap_hdq.c
+++ b/drivers/w1/masters/omap_hdq.c
@@ -18,9 +18,6 @@
 #include <linux/sched.h>
 #include <linux/pm_runtime.h>
 
-#include <asm/irq.h>
-#include <mach/hardware.h>
-
 #include "../w1.h"
 #include "../w1_int.h"
 
-- 
1.7.11


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

* Re: [PATCH 1/6] w1: omap-hdq: add section annotation to remove
  2012-07-25 12:05 [PATCH 1/6] w1: omap-hdq: add section annotation to remove Felipe Balbi
                   ` (4 preceding siblings ...)
  2012-07-25 12:05 ` [PATCH 6/6] w1: omap-hdq: drop ARCH dependency Felipe Balbi
@ 2012-07-26 14:45 ` Evgeniy Polyakov
  2012-07-27  7:04   ` Felipe Balbi
  5 siblings, 1 reply; 10+ messages in thread
From: Evgeniy Polyakov @ 2012-07-26 14:45 UTC (permalink / raw)
  To: Felipe Balbi; +Cc: Linux Kernel Mailing List, Linux OMAP Mailing List

Hi all

On Wed, Jul 25, 2012 at 03:05:27PM +0300, Felipe Balbi (balbi@ti.com) wrote:
> trivial patch, no functional changes.
> 
> Signed-off-by: Felipe Balbi <balbi@ti.com>

Looks good to me
Who should pick it up?

Feel free to add my acked-by: Evgeniy Polyakov <zbr@ioremap.net>

-- 
	Evgeniy Polyakov

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

* Re: [PATCH 1/6] w1: omap-hdq: add section annotation to remove
  2012-07-26 14:45 ` [PATCH 1/6] w1: omap-hdq: add section annotation to remove Evgeniy Polyakov
@ 2012-07-27  7:04   ` Felipe Balbi
  2012-07-31 23:19     ` Evgeniy Polyakov
  0 siblings, 1 reply; 10+ messages in thread
From: Felipe Balbi @ 2012-07-27  7:04 UTC (permalink / raw)
  To: Evgeniy Polyakov
  Cc: Felipe Balbi, Linux Kernel Mailing List, Linux OMAP Mailing List,
	Tony Lindgren

[-- Attachment #1: Type: text/plain, Size: 455 bytes --]

Hi,

On Thu, Jul 26, 2012 at 06:45:26PM +0400, Evgeniy Polyakov wrote:
> Hi all
> 
> On Wed, Jul 25, 2012 at 03:05:27PM +0300, Felipe Balbi (balbi@ti.com) wrote:
> > trivial patch, no functional changes.
> > 
> > Signed-off-by: Felipe Balbi <balbi@ti.com>
> 
> Looks good to me
> Who should pick it up?
> 
> Feel free to add my acked-by: Evgeniy Polyakov <zbr@ioremap.net>

I thought you would :-p Then I guess Tony, maybe ?

-- 
balbi

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

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

* Re: [PATCH 1/6] w1: omap-hdq: add section annotation to remove
  2012-07-27  7:04   ` Felipe Balbi
@ 2012-07-31 23:19     ` Evgeniy Polyakov
  2012-07-31 23:26       ` Greg
  0 siblings, 1 reply; 10+ messages in thread
From: Evgeniy Polyakov @ 2012-07-31 23:19 UTC (permalink / raw)
  To: Felipe Balbi
  Cc: Linux Kernel Mailing List, Linux OMAP Mailing List, Tony Lindgren,
	Greg

On Fri, Jul 27, 2012 at 10:04:44AM +0300, Felipe Balbi (balbi@ti.com) wrote:
> > Feel free to add my acked-by: Evgeniy Polyakov <zbr@ioremap.net>
> 
> I thought you would :-p Then I guess Tony, maybe ?

Greg, will you pick this patchset?
It is fairly simple and without any behaviour changes, but things look
like being stuck here...


-- 
	Evgeniy Polyakov

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

* Re: [PATCH 1/6] w1: omap-hdq: add section annotation to remove
  2012-07-31 23:19     ` Evgeniy Polyakov
@ 2012-07-31 23:26       ` Greg
  0 siblings, 0 replies; 10+ messages in thread
From: Greg @ 2012-07-31 23:26 UTC (permalink / raw)
  To: Evgeniy Polyakov
  Cc: Felipe Balbi, Linux Kernel Mailing List, Linux OMAP Mailing List,
	Tony Lindgren

On Wed, Aug 01, 2012 at 03:19:10AM +0400, Evgeniy Polyakov wrote:
> On Fri, Jul 27, 2012 at 10:04:44AM +0300, Felipe Balbi (balbi@ti.com) wrote:
> > > Feel free to add my acked-by: Evgeniy Polyakov <zbr@ioremap.net>
> > 
> > I thought you would :-p Then I guess Tony, maybe ?
> 
> Greg, will you pick this patchset?
> It is fairly simple and without any behaviour changes, but things look
> like being stuck here...

Yes, after 3.6-rc1 is out I will.

thanks,

greg k-h

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

end of thread, other threads:[~2012-07-31 23:26 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-25 12:05 [PATCH 1/6] w1: omap-hdq: add section annotation to remove Felipe Balbi
2012-07-25 12:05 ` [PATCH 2/6] w1: omap-hdq: don't hardcode resource size Felipe Balbi
2012-07-25 12:05 ` [PATCH 3/6] w1: omap-hdq: convert to module_platform_driver Felipe Balbi
2012-07-25 12:05 ` [PATCH 4/6] w1: omap-hdq: convert to devm_* functions Felipe Balbi
2012-07-25 12:05 ` [PATCH 5/6] w1: omap-hdq: remove unnecessary return Felipe Balbi
2012-07-25 12:05 ` [PATCH 6/6] w1: omap-hdq: drop ARCH dependency Felipe Balbi
2012-07-26 14:45 ` [PATCH 1/6] w1: omap-hdq: add section annotation to remove Evgeniy Polyakov
2012-07-27  7:04   ` Felipe Balbi
2012-07-31 23:19     ` Evgeniy Polyakov
2012-07-31 23:26       ` Greg

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