All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nishanth Menon <nm@ti.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Alessandro Zummo <a.zummo@towertech.it>
Cc: <linux-kernel@vger.kernel.org>, <rtc-linux@googlegroups.com>,
	<linux-omap@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <balbi@ti.com>,
	<grygorii.strashko@ti.com>, Nishanth Menon <nm@ti.com>
Subject: [PATCH V2 2/5] drivers/rtc/rtc-ds1307.c: Switch to managed irq allocation
Date: Tue, 23 Jun 2015 11:15:11 -0500	[thread overview]
Message-ID: <1435076114-12416-3-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1435076114-12416-1-git-send-email-nm@ti.com>

Since we are not doing anything fancy in remove function that requires
us to sequence IRQ free operation, we might as well switch over to devm_
equivalent of managed IRQ allocation and remove the explicit free_irq
since it'd be done automatically at remove.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 drivers/rtc/rtc-ds1307.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 8ea496e54a2e..0a98d8a52791 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -1156,9 +1156,10 @@ read_rtc:
 	}
 
 	if (want_irq) {
-		err = request_threaded_irq(client->irq, NULL, irq_handler,
-					   IRQF_SHARED | IRQF_ONESHOT,
-					   ds1307->rtc->name, client);
+		err = devm_request_threaded_irq(&client->dev,
+						client->irq, NULL, irq_handler,
+						IRQF_SHARED | IRQF_ONESHOT,
+						ds1307->rtc->name, client);
 		if (err) {
 			client->irq = 0;
 			dev_err(&client->dev, "unable to request IRQ!\n");
@@ -1212,9 +1213,6 @@ static int ds1307_remove(struct i2c_client *client)
 {
 	struct ds1307 *ds1307 = i2c_get_clientdata(client);
 
-	if (test_and_clear_bit(HAS_ALARM, &ds1307->flags))
-		free_irq(client->irq, client);
-
 	if (test_and_clear_bit(HAS_NVRAM, &ds1307->flags))
 		sysfs_remove_bin_file(&client->dev.kobj, ds1307->nvram);
 
-- 
1.7.9.5


WARNING: multiple messages have this Message-ID (diff)
From: Nishanth Menon <nm@ti.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Alessandro Zummo <a.zummo@towertech.it>
Cc: <linux-kernel@vger.kernel.org>, <rtc-linux@googlegroups.com>,
	<linux-omap@vger.kernel.org>,
	<linux-arm-kernel@lists.infradead.org>, <balbi@ti.com>,
	<grygorii.strashko@ti.com>, Nishanth Menon <nm@ti.com>
Subject: [rtc-linux] [PATCH V2 2/5] drivers/rtc/rtc-ds1307.c: Switch to managed irq allocation
Date: Tue, 23 Jun 2015 11:15:11 -0500	[thread overview]
Message-ID: <1435076114-12416-3-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1435076114-12416-1-git-send-email-nm@ti.com>

Since we are not doing anything fancy in remove function that requires
us to sequence IRQ free operation, we might as well switch over to devm_
equivalent of managed IRQ allocation and remove the explicit free_irq
since it'd be done automatically at remove.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 drivers/rtc/rtc-ds1307.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 8ea496e54a2e..0a98d8a52791 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -1156,9 +1156,10 @@ read_rtc:
 	}
 
 	if (want_irq) {
-		err = request_threaded_irq(client->irq, NULL, irq_handler,
-					   IRQF_SHARED | IRQF_ONESHOT,
-					   ds1307->rtc->name, client);
+		err = devm_request_threaded_irq(&client->dev,
+						client->irq, NULL, irq_handler,
+						IRQF_SHARED | IRQF_ONESHOT,
+						ds1307->rtc->name, client);
 		if (err) {
 			client->irq = 0;
 			dev_err(&client->dev, "unable to request IRQ!\n");
@@ -1212,9 +1213,6 @@ static int ds1307_remove(struct i2c_client *client)
 {
 	struct ds1307 *ds1307 = i2c_get_clientdata(client);
 
-	if (test_and_clear_bit(HAS_ALARM, &ds1307->flags))
-		free_irq(client->irq, client);
-
 	if (test_and_clear_bit(HAS_NVRAM, &ds1307->flags))
 		sysfs_remove_bin_file(&client->dev.kobj, ds1307->nvram);
 
-- 
1.7.9.5

-- 
-- 
You received this message because you are subscribed to "rtc-linux".
Membership options at http://groups.google.com/group/rtc-linux .
Please read http://groups.google.com/group/rtc-linux/web/checklist
before submitting a driver.
--- 
You received this message because you are subscribed to the Google Groups "rtc-linux" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rtc-linux+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

WARNING: multiple messages have this Message-ID (diff)
From: Nishanth Menon <nm@ti.com>
To: Alexandre Belloni <alexandre.belloni@free-electrons.com>,
	Alessandro Zummo <a.zummo@towertech.it>
Cc: linux-kernel@vger.kernel.org, rtc-linux@googlegroups.com,
	linux-omap@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
	balbi@ti.com, grygorii.strashko@ti.com,
	Nishanth Menon <nm@ti.com>
Subject: [PATCH V2 2/5] drivers/rtc/rtc-ds1307.c: Switch to managed irq allocation
Date: Tue, 23 Jun 2015 11:15:11 -0500	[thread overview]
Message-ID: <1435076114-12416-3-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1435076114-12416-1-git-send-email-nm@ti.com>

Since we are not doing anything fancy in remove function that requires
us to sequence IRQ free operation, we might as well switch over to devm_
equivalent of managed IRQ allocation and remove the explicit free_irq
since it'd be done automatically at remove.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 drivers/rtc/rtc-ds1307.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 8ea496e54a2e..0a98d8a52791 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -1156,9 +1156,10 @@ read_rtc:
 	}
 
 	if (want_irq) {
-		err = request_threaded_irq(client->irq, NULL, irq_handler,
-					   IRQF_SHARED | IRQF_ONESHOT,
-					   ds1307->rtc->name, client);
+		err = devm_request_threaded_irq(&client->dev,
+						client->irq, NULL, irq_handler,
+						IRQF_SHARED | IRQF_ONESHOT,
+						ds1307->rtc->name, client);
 		if (err) {
 			client->irq = 0;
 			dev_err(&client->dev, "unable to request IRQ!\n");
@@ -1212,9 +1213,6 @@ static int ds1307_remove(struct i2c_client *client)
 {
 	struct ds1307 *ds1307 = i2c_get_clientdata(client);
 
-	if (test_and_clear_bit(HAS_ALARM, &ds1307->flags))
-		free_irq(client->irq, client);
-
 	if (test_and_clear_bit(HAS_NVRAM, &ds1307->flags))
 		sysfs_remove_bin_file(&client->dev.kobj, ds1307->nvram);
 
-- 
1.7.9.5

WARNING: multiple messages have this Message-ID (diff)
From: nm@ti.com (Nishanth Menon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH V2 2/5] drivers/rtc/rtc-ds1307.c: Switch to managed irq allocation
Date: Tue, 23 Jun 2015 11:15:11 -0500	[thread overview]
Message-ID: <1435076114-12416-3-git-send-email-nm@ti.com> (raw)
In-Reply-To: <1435076114-12416-1-git-send-email-nm@ti.com>

Since we are not doing anything fancy in remove function that requires
us to sequence IRQ free operation, we might as well switch over to devm_
equivalent of managed IRQ allocation and remove the explicit free_irq
since it'd be done automatically at remove.

Signed-off-by: Nishanth Menon <nm@ti.com>
---
 drivers/rtc/rtc-ds1307.c |   10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/drivers/rtc/rtc-ds1307.c b/drivers/rtc/rtc-ds1307.c
index 8ea496e54a2e..0a98d8a52791 100644
--- a/drivers/rtc/rtc-ds1307.c
+++ b/drivers/rtc/rtc-ds1307.c
@@ -1156,9 +1156,10 @@ read_rtc:
 	}
 
 	if (want_irq) {
-		err = request_threaded_irq(client->irq, NULL, irq_handler,
-					   IRQF_SHARED | IRQF_ONESHOT,
-					   ds1307->rtc->name, client);
+		err = devm_request_threaded_irq(&client->dev,
+						client->irq, NULL, irq_handler,
+						IRQF_SHARED | IRQF_ONESHOT,
+						ds1307->rtc->name, client);
 		if (err) {
 			client->irq = 0;
 			dev_err(&client->dev, "unable to request IRQ!\n");
@@ -1212,9 +1213,6 @@ static int ds1307_remove(struct i2c_client *client)
 {
 	struct ds1307 *ds1307 = i2c_get_clientdata(client);
 
-	if (test_and_clear_bit(HAS_ALARM, &ds1307->flags))
-		free_irq(client->irq, client);
-
 	if (test_and_clear_bit(HAS_NVRAM, &ds1307->flags))
 		sysfs_remove_bin_file(&client->dev.kobj, ds1307->nvram);
 
-- 
1.7.9.5

  parent reply	other threads:[~2015-06-23 16:17 UTC|newest]

Thread overview: 61+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-23 16:15 [PATCH V2 0/5] drivers/rtc/rtc-ds1307.c: Basic cleanups and support for wakeupirq Nishanth Menon
2015-06-23 16:15 ` Nishanth Menon
2015-06-23 16:15 ` Nishanth Menon
2015-06-23 16:15 ` [rtc-linux] " Nishanth Menon
2015-06-23 16:15 ` [PATCH V2 1/5] drivers/rtc/rtc-ds1307.c: Convert to threaded IRQ Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` [rtc-linux] " Nishanth Menon
2015-06-23 16:15 ` Nishanth Menon [this message]
2015-06-23 16:15   ` [PATCH V2 2/5] drivers/rtc/rtc-ds1307.c: Switch to managed irq allocation Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` [rtc-linux] " Nishanth Menon
2015-06-23 16:15 ` [PATCH V2 3/5] drivers/rtc/rtc-ds1307.c: Sort the headers Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` [rtc-linux] " Nishanth Menon
2015-06-23 16:15 ` [PATCH V2 4/5] drivers/rtc/rtc-ds1307.c: Support optional wakeup interrupt source Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` [rtc-linux] " Nishanth Menon
2015-06-24 10:54   ` Tony Lindgren
2015-06-24 10:54     ` Tony Lindgren
2015-06-24 10:54     ` [rtc-linux] " Tony Lindgren
2015-06-24 15:36   ` Grygorii Strashko
2015-06-24 15:36     ` Grygorii Strashko
2015-06-24 15:36     ` Grygorii Strashko
2015-06-24 15:36     ` [rtc-linux] " Grygorii Strashko
2015-06-24 16:07     ` Nishanth Menon
2015-06-24 16:07       ` Nishanth Menon
2015-06-24 16:07       ` Nishanth Menon
2015-06-24 16:07       ` [rtc-linux] " Nishanth Menon
2015-06-24 16:25       ` Grygorii Strashko
2015-06-24 16:25         ` Grygorii Strashko
2015-06-24 16:25         ` Grygorii Strashko
2015-06-24 16:25         ` [rtc-linux] " Grygorii Strashko
2015-06-24 16:26       ` Nishanth Menon
2015-06-24 16:26         ` Nishanth Menon
2015-06-24 16:26         ` Nishanth Menon
2015-06-24 16:26         ` [rtc-linux] " Nishanth Menon
2015-06-25 17:23         ` Grygorii Strashko
2015-06-25 17:23           ` Grygorii Strashko
2015-06-25 17:23           ` Grygorii Strashko
2015-06-25 17:23           ` [rtc-linux] " Grygorii Strashko
2015-07-01 12:54         ` Alexandre Belloni
2015-07-01 12:54           ` Alexandre Belloni
2015-07-01 12:54           ` [rtc-linux] " Alexandre Belloni
2015-06-23 16:15 ` [TMP PATCH V2 5/5] ARM: dts: am57xx-beagle-x15: Add wakeup irq for mcp79410 Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` Nishanth Menon
2015-06-23 16:15   ` [rtc-linux] " Nishanth Menon
2015-06-24 14:34 ` [PATCH V2 0/5] drivers/rtc/rtc-ds1307.c: Basic cleanups and support for wakeupirq Felipe Balbi
2015-06-24 14:34   ` Felipe Balbi
2015-06-24 14:34   ` Felipe Balbi
2015-06-24 14:34   ` [rtc-linux] " Felipe Balbi
2015-06-24 15:37   ` Grygorii Strashko
2015-06-24 15:37     ` Grygorii Strashko
2015-06-24 15:37     ` Grygorii Strashko
2015-06-24 15:37     ` [rtc-linux] " Grygorii Strashko
2015-07-02 22:47 ` Alexandre Belloni
2015-07-02 22:47   ` Alexandre Belloni
2015-07-02 22:47   ` [rtc-linux] " Alexandre Belloni

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435076114-12416-3-git-send-email-nm@ti.com \
    --to=nm@ti.com \
    --cc=a.zummo@towertech.it \
    --cc=alexandre.belloni@free-electrons.com \
    --cc=balbi@ti.com \
    --cc=grygorii.strashko@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rtc-linux@googlegroups.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.