[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53AC003E.2010608@collabora.co.uk>
Date: Thu, 26 Jun 2014 13:13:02 +0200
From: Javier Martinez Canillas <javier.martinez@...labora.co.uk>
To: Krzysztof Kozlowski <k.kozlowski@...sung.com>
CC: Lee Jones <lee.jones@...aro.org>,
Samuel Ortiz <sameo@...ux.intel.com>,
Mark Brown <broonie@...nel.org>,
Mike Turquette <mturquette@...aro.org>,
Liam Girdwood <lgirdwood@...il.com>,
Alessandro Zummo <a.zummo@...ertech.it>,
Kukjin Kim <kgene.kim@...sung.com>,
Doug Anderson <dianders@...omium.org>,
Olof Johansson <olof@...om.net>,
Sjoerd Simons <sjoerd.simons@...labora.co.uk>,
Daniel Stone <daniels@...labora.com>,
Tomeu Vizoso <tomeu.vizoso@...labora.com>,
linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
linux-samsung-soc@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 07/14] mfd: Add driver for Maxim 77802 Power Management
IC
Hello Krzysztof,
Thanks a lot for your feedback.
On 06/26/2014 11:31 AM, Krzysztof Kozlowski wrote:
> Hi,
>
> Just a few nit-picks below but overall everything looks fine:
>
> Reviewed-by: Krzysztof Kozlowski <k.kozlowski@...sung.com>
>
>
>> +
>> +static int max77802_i2c_probe(struct i2c_client *i2c,
>> + const struct i2c_device_id *id)
>> +{
>> + struct max77802_dev *max77802 = NULL;
>> + struct max77802_platform_data *pdata = dev_get_platdata(&i2c->dev);
>> + unsigned int data;
>> + int ret = 0;
>> +
>> + if (i2c->dev.of_node)
>> + pdata = max77802_i2c_parse_dt_pdata(&i2c->dev);
>> +
>> + if (!pdata) {
>> + dev_err(&i2c->dev, "No platform data found.\n");
>> + return -EIO;
>> + }
>> +
>> + max77802 = devm_kzalloc(&i2c->dev, sizeof(struct max77802_dev),
>> + GFP_KERNEL);
>> + if (max77802 == NULL)
>
> It is inconsistent. Before you used "(!pd)" and "(!pdata)" so maybe
> stick to one format?
>
Right, I'll change to "(!max77802)" as well to be consistent.
>> +
>> +#ifdef CONFIG_PM_SLEEP
>> +static int max77802_suspend(struct device *dev)
>> +{
>> + struct i2c_client *i2c = container_of(dev, struct i2c_client, dev);
>> + struct max77802_dev *max77802 = i2c_get_clientdata(i2c);
>> +
>> + if (device_may_wakeup(dev))
>> + enable_irq_wake(max77802->irq);
>> +
>> + disable_irq(max77802->irq);
>
> Can you add short comment why this is needed? I know why but just for
> future generations which will wonder: "why do we need to disable the IRQ
> while suspending?" :). Especially that this is rather a workaround for
> issue in other driver (I2C bus).
>
Good idea, I'll add a comment here on next version so code archaeologists can
figure out what what's going on here.
>> +
>> +#define MAX77802_IRQSRC_PMIC (0)
>
> Shouldn't it be BIT(0) or BIT(1)? It looks odd.
>
>> +#define MAX77802_IRQSRC_RTC BIT(0)
>
> Anyway, are these defines used anywhere? Seems not.
>
Yes, these defines were used in the max77802-irq.c so is a left over from the
regmap IRQ chip refactoring. I'll remove these and also the ones from max77686
driver.
> Best regards,
> Krzysztof
>
>
Best regards
Javier
--
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