[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <53B50E02.9070809@ti.com>
Date: Thu, 3 Jul 2014 11:02:10 +0300
From: Roger Quadros <rogerq@...com>
To: Sergei Shtylyov <sergei.shtylyov@...entembedded.com>,
<tony@...mide.com>, <kishon@...com>, <balbi@...com>
CC: <nsekhar@...com>, <nm@...com>, <george.cherian@...com>,
<linux-omap@...r.kernel.org>, <linux-usb@...r.kernel.org>,
<linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 3/6] phy: core: Support regulator supply for PHY power
On 07/02/2014 03:32 PM, Sergei Shtylyov wrote:
> Hello.
>
> On 07/02/2014 04:03 PM, Roger Quadros wrote:
>
>> Some PHYs can be powered by an external power regulator.
>> e.g. USB_HS PHY on DRA7 SoC. Make the PHY core support a
>> power regulator.
>
>> Signed-off-by: Roger Quadros <rogerq@...com>
>> ---
>> drivers/phy/phy-core.c | 32 ++++++++++++++++++++++++++++++++
>> include/linux/phy/phy.h | 2 ++
>> 2 files changed, 34 insertions(+)
>
>> diff --git a/drivers/phy/phy-core.c b/drivers/phy/phy-core.c
>> index 49c4465..d817107 100644
>> --- a/drivers/phy/phy-core.c
>> +++ b/drivers/phy/phy-core.c
> [...]
>> @@ -664,6 +689,10 @@ EXPORT_SYMBOL_GPL(devm_phy_create);
>> void phy_destroy(struct phy *phy)
>> {
>> pm_runtime_disable(&phy->dev);
>> +
>> + if (phy->pwr)
>> + regulator_put(phy->pwr);
>
> regulator_put() already handles NULL pointer.
Good to know that. I'll remove the 'if' then.
cheers,
-roger
>
>> +
>> device_unregister(&phy->dev);
>> }
>> EXPORT_SYMBOL_GPL(phy_destroy);
>> @@ -800,6 +829,9 @@ static void phy_release(struct device *dev)
>>
>> phy = to_phy(dev);
>> dev_vdbg(dev, "releasing '%s'\n", dev_name(dev));
>> + if (phy->pwr)
>> + regulator_put(phy->pwr);
>
> Same comment here.
>
>> +
>> ida_simple_remove(&phy_ida, phy->id);
>> kfree(phy);
>> }
>
> WBR, Sergei
>
--
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