From: Viresh Kumar <viresh.kumar@st.com>
To: Christopher BLAIR <chris.blair@stericsson.com>
Cc: Linus WALLEIJ <linus.walleij@stericsson.com>,
Samuel Ortiz <sameo@linux.intel.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Michel JAOUEN <michel.jaouen@stericsson.com>,
Linus Walleij <linus.walleij@linaro.org>,
Shiraz HASHIM <shiraz.hashim@st.com>,
Armando VISCONTI <armando.visconti@st.com>
Subject: Re: [PATCH] mfd/stmpe: Add support for no-interrupt config
Date: Tue, 24 Jan 2012 17:04:12 +0530 [thread overview]
Message-ID: <4F1E9734.1040807@st.com> (raw)
In-Reply-To: <1327400314-18030-1-git-send-email-linus.walleij@stericsson.com>
On 1/24/2012 3:48 PM, Linus WALLEIJ wrote:
> From: Chris Blair <chris.blair@stericsson.com>
>
> Adds support for boards which have an STMPE device without the
> interrupt pin connected.
>
> Cc: Viresh Kumar <viresh.kumar@st.com>
> Signed-off-by: Chris Blair <chris.blair@stericsson.com>
> Tested-by: Michel Jaouen <michel.jaouen@stericsson.com>
> Reviewed-by: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
> Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
> ---
> drivers/mfd/stmpe.c | 72 +++++++++++++++++++++++++--------------------
> include/linux/mfd/stmpe.h | 2 +
> 2 files changed, 42 insertions(+), 32 deletions(-)
>
> diff --git a/drivers/mfd/stmpe.c b/drivers/mfd/stmpe.c
> @@ -988,7 +990,7 @@ int __devinit stmpe_probe(struct stmpe_client_info *ci, int partnum)
> if (ci->init)
> ci->init(stmpe);
>
> - if (pdata->irq_over_gpio) {
> + if (!pdata->no_irq && pdata->irq_over_gpio) {
> ret = gpio_request_one(pdata->irq_gpio, GPIOF_DIR_IN, "stmpe");
> if (ret) {
> dev_err(stmpe->dev, "failed to request IRQ GPIO: %d\n",
[I will add the actual code present here after this change to describe the concern]
if (!pdata->no_irq && pdata->irq_over_gpio) {
ret = gpio_request_one(pdata->irq_gpio, GPIOF_DIR_IN, "stmpe");
if (ret) {
dev_err(stmpe->dev, "failed to request IRQ GPIO: %d\n",
ret);
goto out_free;
}
stmpe->irq = gpio_to_irq(pdata->irq_gpio);
} else {
stmpe->irq = ci->irq;
}
Actually you want neither of them to work for no_irq case, if and else.
But with this code, if you pass no_irq = true, then else part will get called.
> @@ -1005,15 +1007,21 @@ int __devinit stmpe_probe(struct stmpe_client_info *ci, int partnum)
> if (ret)
> goto free_gpio;
>
> - ret = stmpe_irq_init(stmpe);
> - if (ret)
> - goto free_gpio;
> + if (pdata->no_irq) {
> + dev_info(stmpe->dev,
> + "board config says IRQs are not supported\n");
> + } else {
> + ret = stmpe_irq_init(stmpe);
> + if (ret)
> + goto free_gpio;
>
There are few more cases to handle in error part of probe and remove, where
following routines are called.
free_irq(stmpe->irq, stmpe);
stmpe_irq_remove(stmpe);
if (pdata->irq_over_gpio)
gpio_free(pdata->irq_gpio);
--
viresh
next prev parent reply other threads:[~2012-01-24 11:34 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-01-24 10:18 [PATCH] mfd/stmpe: Add support for no-interrupt config Linus Walleij
2012-01-24 11:34 ` Viresh Kumar [this message]
2012-02-20 17:06 ` Samuel Ortiz
2012-02-20 17:11 ` Samuel Ortiz
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=4F1E9734.1040807@st.com \
--to=viresh.kumar@st.com \
--cc=armando.visconti@st.com \
--cc=chris.blair@stericsson.com \
--cc=linus.walleij@linaro.org \
--cc=linus.walleij@stericsson.com \
--cc=linux-kernel@vger.kernel.org \
--cc=michel.jaouen@stericsson.com \
--cc=sameo@linux.intel.com \
--cc=shiraz.hashim@st.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox