From: Felipe Balbi <felipe.balbi@nokia.com>
To: "ext hvaibhav@ti.com" <hvaibhav@ti.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
"byron.bbradley@gmail.com" <byron.bbradley@gmail.com>,
"linux-omap@vger.kernel.org" <linux-omap@vger.kernel.org>
Subject: Re: [PATCH 1/3] RTC:s35390a: Add Alarm interrupt support
Date: Tue, 17 Aug 2010 12:28:45 +0300 [thread overview]
Message-ID: <20100817092845.GE19211@nokia.com> (raw)
In-Reply-To: <1282034921-22167-2-git-send-email-hvaibhav@ti.com>
On Tue, Aug 17, 2010 at 10:48:39AM +0200, ext hvaibhav@ti.com wrote:
>From: Vaibhav Hiremath <hvaibhav@ti.com>
you need a description here.
>Signed-off-by: Vaibhav Hiremath <hvaibhav@ti.com>
[snip]
>+static void s35390a_work(struct work_struct *work)
>+{
>+ struct s35390a *s35390a;
>+ struct i2c_client *client;
>+ char buf[1];
>+
>+ s35390a = container_of(work, struct s35390a, work);
>+ if (!s35390a)
>+ return;
container_of() will never return NULL. You can remove this check. You
won't need this, actually after converting to threaded_irq, see below.
>+static irqreturn_t s35390a_irq(int irq, void *client)
>+{
>+ struct s35390a *s35390a;
all the other drivers will do:
static irqreturn_t s35390a_irq(int irq, void *_s35390a)
{
struct s35390a *s35390a = _s35390a
[...]
>+ if (!client)
>+ return IRQ_HANDLED;
if client is NULL, you should let this oops.
>+ schedule_work(&s35390a->work);
please don't use workqueue. Use threaded IRQ.
>@@ -261,15 +447,30 @@ static int s35390a_probe(struct i2c_client *client,
> if (s35390a_get_datetime(client, &tm) < 0)
> dev_warn(&client->dev, "clock needs to be set\n");
>
>+ INIT_WORK(&s35390a->work, s35390a_work);
>+
>+ if (client->irq > 0) {
irq 0 is a valid number.
>+ err = request_irq(client->irq, s35390a_irq, IRQF_TRIGGER_LOW,
>+ client->name, client);
instead of the i2c client, you can pass s35390. Also use
request_threaded_irq();
--
balbi
DefectiveByDesign.org
next prev parent reply other threads:[~2010-08-17 9:28 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-08-17 8:48 [PATCH 1/3] RTC:s35390a: Add Alarm interrupt support hvaibhav
2010-08-17 9:28 ` Felipe Balbi [this message]
2010-08-18 18:13 ` Hiremath, Vaibhav
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=20100817092845.GE19211@nokia.com \
--to=felipe.balbi@nokia.com \
--cc=akpm@linux-foundation.org \
--cc=byron.bbradley@gmail.com \
--cc=hvaibhav@ti.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox