[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAJAp7OgfkFjFi7_V93WRT+ySHOgvoCH4DpNKwrPgaOjggoSeww@mail.gmail.com>
Date: Thu, 18 Jun 2015 09:37:41 -0700
From: Bjorn Andersson <bjorn@...o.se>
To: Marc Zyngier <marc.zyngier@....com>
Cc: Bjorn Andersson <bjorn.andersson@...ymobile.com>,
Kumar Gala <galak@...eaurora.org>,
Andy Gross <agross@...eaurora.org>,
Samuel Ortiz <sameo@...ux.intel.com>,
Lee Jones <lee.jones@...aro.org>,
Linus Walleij <linus.walleij@...aro.org>,
"linux-arm-msm@...r.kernel.org" <linux-arm-msm@...r.kernel.org>,
"linux-soc@...r.kernel.org" <linux-soc@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 7/8] mfd: pm8921: Implement irq_get_irqchip_state
On Thu, Jun 18, 2015 at 12:32 AM, Marc Zyngier <marc.zyngier@....com> wrote:
> Hi Bjorn,
>
[..]
>> diff --git a/drivers/mfd/pm8921-core.c b/drivers/mfd/pm8921-core.c
[..]
>> +static int pm8xxx_irq_get_irqchip_state(struct irq_data *d,
>> + enum irqchip_irq_state which,
>> + bool *state)
>> +{
>> + struct pm_irq_chip *chip = irq_data_get_irq_chip_data(d);
>> + unsigned int pmirq = irqd_to_hwirq(d);
>> + unsigned int bits;
>> + int irq_bit;
>> + u8 block;
>> + int rc;
>> +
>> + if (!chip) {
>> + pr_err("Failed to resolve pm_irq_chip\n");
>> + return -EINVAL;
>> + }
>
> Why do you need to check this? Is there any code path that could
> actually trigger this?
>
This is a remnant of times before our new fancy api, from what I can
see it should be dropped.
>> +
>> + if (which != IRQCHIP_STATE_LINE_LEVEL)
>> + return -EINVAL;
>> +
>> + block = pmirq / 8;
>> + irq_bit = pmirq % 8;
>> +
>> + spin_lock(&chip->pm_irq_lock);
>> + rc = regmap_write(chip->regmap, SSBI_REG_ADDR_IRQ_BLK_SEL, block);
>> + if (rc) {
>> + pr_err("Failed Selecting Block %d rc=%d\n", block, rc);
>> + goto bail;
>> + }
>> +
>> + rc = regmap_read(chip->regmap, SSBI_REG_ADDR_IRQ_RT_STATUS, &bits);
>> + if (rc) {
>> + pr_err("Failed Reading Status rc=%d\n", rc);
>> + goto bail;
>> + }
>> +
>> + *state = !!(bits & BIT(irq_bit));
>> +bail:
>> + spin_unlock(&chip->pm_irq_lock);
>> +
>> + return rc ? rc : 0;
>
> I think you can just have "return rc;" here.
>
You're right.
Thanks for the review!
Regards,
Bjorn
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists