From: Sekhar Nori <nsekhar@ti.com>
To: Franklin S Cooper Jr <fcooper@ti.com>, <wsa@the-dreams.de>,
<robh+dt@kernel.org>, <linux@armlinux.org.uk>,
<linux-i2c@vger.kernel.org>, <devicetree@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<grygorii.strashko@ti.com>, <vigneshr@ti.com>
Subject: Re: [PATCH v2 2/3] i2c: davinci: Add PM Runtime Support
Date: Tue, 22 Aug 2017 10:52:39 +0530 [thread overview]
Message-ID: <bd204f3b-8bfd-9015-18cc-dd915c88b812@ti.com> (raw)
In-Reply-To: <d06ef5c6-6501-eca6-2fa2-976d085091b2@ti.com>
On Tuesday 22 August 2017 06:47 AM, Franklin S Cooper Jr wrote:
>
>
> On 08/21/2017 04:05 AM, Sekhar Nori wrote:
>> On Thursday 17 August 2017 03:47 AM, Franklin S Cooper Jr wrote:
>>
>>> @@ -802,7 +821,6 @@ static int davinci_i2c_probe(struct platform_device *pdev)
>>> dev->clk = devm_clk_get(&pdev->dev, NULL);
>>> if (IS_ERR(dev->clk))
>>> return PTR_ERR(dev->clk);
>>> - clk_prepare_enable(dev->clk);
>>>
>>> mem = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>>> dev->base = devm_ioremap_resource(&pdev->dev, mem);
>>> @@ -811,6 +829,18 @@ static int davinci_i2c_probe(struct platform_device *pdev)
>>> goto err_unuse_clocks;
>>
>> This goto is wrong now. There is no need to unwind the pm_runtime setup
>> on a devm_ioremap_resource() failure. You can just return error here.
>
> Ok
>>
>>> }
>>>
>>> + pm_runtime_set_autosuspend_delay(dev->dev,
>>> + DAVINCI_I2C_PM_TIMEOUT);
>>> + pm_runtime_use_autosuspend(dev->dev);
>>> +
>>> + pm_runtime_enable(dev->dev);
>>> +
>>> + r = pm_runtime_get_sync(dev->dev);
>>> + if (r < 0) {
>>> + dev_err(dev->dev, "failed to runtime_get device: %d\n", r);
>>> + goto err_unuse_clocks;
>>> + }
>>> +
>>> i2c_davinci_init(dev);
>>>
>>> r = devm_request_irq(&pdev->dev, dev->irq, i2c_davinci_isr, 0,
>>> @@ -849,10 +879,16 @@ static int davinci_i2c_probe(struct platform_device *pdev)
>>> if (r)
>>> goto err_unuse_clocks;
>>>
>>> + pm_runtime_mark_last_busy(dev->dev);
>>> + pm_runtime_put_autosuspend(dev->dev);
>>> +
>>> return 0;
>>>
>>> err_unuse_clocks:
>>> - clk_disable_unprepare(dev->clk);
>>> + pm_runtime_dont_use_autosuspend(dev->dev);
>>> + pm_runtime_put_sync(dev->dev);
>>> + pm_runtime_disable(dev->dev);
>>> +
>>> dev->clk = NULL;
>>
>> This null setting of clk seems quite bogus and can be cleaned-up.
>
> Do you mean that I should just remove this line?
Yes, and I noticed a similar line in at least one more place that can be
removed as well.
Thanks,
Sekhar
next prev parent reply other threads:[~2017-08-22 5:23 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-16 22:17 [PATCH v2 0/3] ARM: dts: keystone-k2g: Add I2C support for 66AK2G Franklin S Cooper Jr
2017-08-16 22:17 ` [PATCH v2 1/3] i2c: davinci: Preserve return value of devm_clk_get Franklin S Cooper Jr
2017-08-21 9:40 ` Sekhar Nori
2017-08-27 13:34 ` Wolfram Sang
2017-08-16 22:17 ` [PATCH v2 2/3] i2c: davinci: Add PM Runtime Support Franklin S Cooper Jr
2017-08-17 16:24 ` Wolfram Sang
2017-08-21 9:09 ` Sekhar Nori
2017-08-21 9:05 ` Sekhar Nori
2017-08-22 1:17 ` Franklin S Cooper Jr
2017-08-22 5:22 ` Sekhar Nori [this message]
2017-08-16 22:17 ` [PATCH v2 3/3] dt-bindings: i2c: i2c-davinci: Update binding for 66AK2Gx pwr dm property Franklin S Cooper Jr
2017-08-21 9:51 ` Sekhar Nori
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=bd204f3b-8bfd-9015-18cc-dd915c88b812@ti.com \
--to=nsekhar@ti.com \
--cc=devicetree@vger.kernel.org \
--cc=fcooper@ti.com \
--cc=grygorii.strashko@ti.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=robh+dt@kernel.org \
--cc=vigneshr@ti.com \
--cc=wsa@the-dreams.de \
/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
all inboxes | Powered by JetHome®