From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Graeme Gregory <gg@slimlogic.co.uk>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
Kevin Hilman <khilman@linaro.org>,
linux-omap@vger.kernel.org,
Ruslan Bilovol <ruslan.bilovol@ti.com>,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/4] mfd: twl6030-irq: add error check when IRQs are masked initially
Date: Wed, 24 Jul 2013 14:51:40 +0300 [thread overview]
Message-ID: <51EFBFCC.9060302@ti.com> (raw)
In-Reply-To: <51EEC69F.9000006@slimlogic.co.uk>
On 07/23/2013 09:08 PM, Graeme Gregory wrote:
> On 23/07/13 17:07, Grygorii Strashko wrote:
>> Add a missed check for errors when TWL IRQs are masked
>> initially on probe and report an error in case of failure.
>>
>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>> ---
>> drivers/mfd/twl6030-irq.c | 13 +++++++++----
>> 1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
>> index b6030d9..790cc28 100644
>> --- a/drivers/mfd/twl6030-irq.c
>> +++ b/drivers/mfd/twl6030-irq.c
>> @@ -313,7 +313,7 @@ int twl6030_init_irq(struct device *dev, int irq_num)
>> struct device_node *node = dev->of_node;
>> int nr_irqs, irq_base, irq_end;
>> static struct irq_chip twl6030_irq_chip;
>> - int status = 0;
>> + int status;
>> int i;
>> u8 mask[3];
>>
>> @@ -335,11 +335,16 @@ int twl6030_init_irq(struct device *dev, int irq_num)
>> mask[2] = 0xFF;
>>
>> /* mask all int lines */
>> - twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_LINE_A, 3);
>> + status = twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_LINE_A, 3);
>> /* mask all int sts */
>> - twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_STS_A, 3);
>> + status |= twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_STS_A, 3);
>> /* clear INT_STS_A,B,C */
>> - twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_STS_A, 3);
>> + status |= twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_STS_A, 3);
>> +
> You can save two i2c writes here for slightly faster initialisation,
> only one of the REG_INT_STS_A registers needs to be written to clear
> them all. As per the irq handling routine comment.
Good point. thanks
>> + if (status < 0) {
>> + dev_err(dev, "I2C err writing TWL_MODULE_PIH: %d\n", status);
>> + return status;
>> + }
>>
>> twl6030_irq_base = irq_base;
>>
>
> Graeme
>
Regards,
- grygorii
WARNING: multiple messages have this Message-ID (diff)
From: Grygorii Strashko <grygorii.strashko@ti.com>
To: Graeme Gregory <gg@slimlogic.co.uk>
Cc: Samuel Ortiz <sameo@linux.intel.com>,
Lee Jones <lee.jones@linaro.org>,
Kevin Hilman <khilman@linaro.org>, <linux-omap@vger.kernel.org>,
Ruslan Bilovol <ruslan.bilovol@ti.com>,
<linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] mfd: twl6030-irq: add error check when IRQs are masked initially
Date: Wed, 24 Jul 2013 14:51:40 +0300 [thread overview]
Message-ID: <51EFBFCC.9060302@ti.com> (raw)
In-Reply-To: <51EEC69F.9000006@slimlogic.co.uk>
On 07/23/2013 09:08 PM, Graeme Gregory wrote:
> On 23/07/13 17:07, Grygorii Strashko wrote:
>> Add a missed check for errors when TWL IRQs are masked
>> initially on probe and report an error in case of failure.
>>
>> Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
>> ---
>> drivers/mfd/twl6030-irq.c | 13 +++++++++----
>> 1 file changed, 9 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/mfd/twl6030-irq.c b/drivers/mfd/twl6030-irq.c
>> index b6030d9..790cc28 100644
>> --- a/drivers/mfd/twl6030-irq.c
>> +++ b/drivers/mfd/twl6030-irq.c
>> @@ -313,7 +313,7 @@ int twl6030_init_irq(struct device *dev, int irq_num)
>> struct device_node *node = dev->of_node;
>> int nr_irqs, irq_base, irq_end;
>> static struct irq_chip twl6030_irq_chip;
>> - int status = 0;
>> + int status;
>> int i;
>> u8 mask[3];
>>
>> @@ -335,11 +335,16 @@ int twl6030_init_irq(struct device *dev, int irq_num)
>> mask[2] = 0xFF;
>>
>> /* mask all int lines */
>> - twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_LINE_A, 3);
>> + status = twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_LINE_A, 3);
>> /* mask all int sts */
>> - twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_STS_A, 3);
>> + status |= twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_MSK_STS_A, 3);
>> /* clear INT_STS_A,B,C */
>> - twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_STS_A, 3);
>> + status |= twl_i2c_write(TWL_MODULE_PIH, &mask[0], REG_INT_STS_A, 3);
>> +
> You can save two i2c writes here for slightly faster initialisation,
> only one of the REG_INT_STS_A registers needs to be written to clear
> them all. As per the irq handling routine comment.
Good point. thanks
>> + if (status < 0) {
>> + dev_err(dev, "I2C err writing TWL_MODULE_PIH: %d\n", status);
>> + return status;
>> + }
>>
>> twl6030_irq_base = irq_base;
>>
>
> Graeme
>
Regards,
- grygorii
next prev parent reply other threads:[~2013-07-24 11:51 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-23 16:07 [PATCH 0/4] mfd: twl6030-irq: rework and add twl6032 support Grygorii Strashko
2013-07-23 16:07 ` Grygorii Strashko
2013-07-23 16:07 ` [PATCH 1/4] mfd: twl6030-irq: migrate to IRQ threaded handler Grygorii Strashko
2013-07-23 16:07 ` Grygorii Strashko
2013-07-24 10:49 ` Lee Jones
2013-07-24 11:54 ` Grygorii Strashko
2013-07-24 11:54 ` Grygorii Strashko
2013-07-24 12:50 ` Lee Jones
2013-07-24 12:50 ` Lee Jones
2013-07-24 13:17 ` Grygorii Strashko
2013-07-24 13:17 ` Grygorii Strashko
2013-07-24 11:54 ` Lee Jones
2013-07-24 11:54 ` Lee Jones
2013-07-23 16:07 ` [PATCH 2/4] mfd: twl6030-irq: add error check when IRQs are masked initially Grygorii Strashko
2013-07-23 16:07 ` Grygorii Strashko
2013-07-23 18:08 ` Graeme Gregory
2013-07-24 11:51 ` Grygorii Strashko [this message]
2013-07-24 11:51 ` Grygorii Strashko
2013-07-23 16:07 ` [PATCH 3/4] mfd: twl6030-irq: convert to use linear irq_domain Grygorii Strashko
2013-07-23 16:07 ` Grygorii Strashko
2013-07-24 11:35 ` Lee Jones
2013-07-24 11:35 ` Lee Jones
2013-07-24 13:37 ` Grygorii Strashko
2013-07-24 13:37 ` Grygorii Strashko
2013-07-23 16:07 ` [PATCH 4/4] mfd: twl6030-irq: Add interrupt mapping table for the twl6032 Grygorii Strashko
2013-07-23 16:07 ` Grygorii Strashko
2013-07-24 11:52 ` Lee Jones
2013-07-24 13:39 ` Grygorii Strashko
2013-07-24 13:39 ` Grygorii Strashko
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=51EFBFCC.9060302@ti.com \
--to=grygorii.strashko@ti.com \
--cc=gg@slimlogic.co.uk \
--cc=khilman@linaro.org \
--cc=lee.jones@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-omap@vger.kernel.org \
--cc=ruslan.bilovol@ti.com \
--cc=sameo@linux.intel.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.