* [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable
@ 2017-05-19 10:56 ` Arvind Yadav
2017-05-23 9:41 ` Chanwoo Choi
0 siblings, 1 reply; 4+ messages in thread
From: Arvind Yadav @ 2017-05-19 10:56 UTC (permalink / raw)
To: myungjoo.ham, kyungmin.park, krzk, kgene, javier
Cc: linux-pm, linux-arm-kernel, linux-samsung-soc, linux-kernel
clk_prepare_enable() can fail here and we must check its return value.
Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
---
drivers/devfreq/event/exynos-ppmu.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
index 9b73509..8f6537a 100644
--- a/drivers/devfreq/event/exynos-ppmu.c
+++ b/drivers/devfreq/event/exynos-ppmu.c
@@ -648,7 +648,11 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
dev_name(&pdev->dev), desc[i].name);
}
- clk_prepare_enable(info->ppmu.clk);
+ ret = clk_prepare_enable(info->ppmu.clk);
+ if (ret) {
+ dev_err(&pdev->dev, "failed to prepare ppmu clock\n");
+ return ret;
+ }
return 0;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable
2017-05-19 10:56 ` [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable Arvind Yadav
@ 2017-05-23 9:41 ` Chanwoo Choi
2017-05-24 1:30 ` MyungJoo Ham
0 siblings, 1 reply; 4+ messages in thread
From: Chanwoo Choi @ 2017-05-23 9:41 UTC (permalink / raw)
To: Arvind Yadav, myungjoo.ham, kyungmin.park, krzk, kgene, javier
Cc: linux-pm, linux-arm-kernel, linux-samsung-soc, linux-kernel
On 2017년 05월 19일 19:56, Arvind Yadav wrote:
> clk_prepare_enable() can fail here and we must check its return value.
>
> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> ---
> drivers/devfreq/event/exynos-ppmu.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
> index 9b73509..8f6537a 100644
> --- a/drivers/devfreq/event/exynos-ppmu.c
> +++ b/drivers/devfreq/event/exynos-ppmu.c
> @@ -648,7 +648,11 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
> dev_name(&pdev->dev), desc[i].name);
> }
>
> - clk_prepare_enable(info->ppmu.clk);
> + ret = clk_prepare_enable(info->ppmu.clk);
> + if (ret) {
> + dev_err(&pdev->dev, "failed to prepare ppmu clock\n");
> + return ret;
> + }
You're right. But, actually, some ppmu device-tree node doesn't include
the clock information because exynos clk driver don't support the
clock for some ppmu devices. Until now, the clock of ppmu devices
are default on state.
Before applying this patch, exynos clock driver have to support
the ppmu's clock and then add the clock information to the device tree
of ppmu devices.
>
> return 0;
> }
>
--
Best Regards,
Chanwoo Choi
Samsung Electronics
^ permalink raw reply [flat|nested] 4+ messages in thread
* RE: Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable
2017-05-23 9:41 ` Chanwoo Choi
@ 2017-05-24 1:30 ` MyungJoo Ham
2017-05-24 1:54 ` Chanwoo Choi
0 siblings, 1 reply; 4+ messages in thread
From: MyungJoo Ham @ 2017-05-24 1:30 UTC (permalink / raw)
To: Chanwoo Choi, Arvind Yadav, Kyungmin Park, krzk@kernel.org,
kgene@kernel.org, javier@osg.samsung.com
Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
> On 2017년 05월 19일 19:56, Arvind Yadav wrote:
> > clk_prepare_enable() can fail here and we must check its return value.
> >
> > Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
> > ---
> > drivers/devfreq/event/exynos-ppmu.c | 6 +++++-
> > 1 file changed, 5 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
> > index 9b73509..8f6537a 100644
> > --- a/drivers/devfreq/event/exynos-ppmu.c
> > +++ b/drivers/devfreq/event/exynos-ppmu.c
> > @@ -648,7 +648,11 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
> > dev_name(&pdev->dev), desc[i].name);
> > }
> >
> > - clk_prepare_enable(info->ppmu.clk);
> > + ret = clk_prepare_enable(info->ppmu.clk);
> > + if (ret) {
> > + dev_err(&pdev->dev, "failed to prepare ppmu clock\n");
> > + return ret;
> > + }
>
> You're right. But, actually, some ppmu device-tree node doesn't include
> the clock information because exynos clk driver don't support the
> clock for some ppmu devices. Until now, the clock of ppmu devices
> are default on state.
If it does not include the clock information, info->ppmu.clk is NULL,
which makes ret == NULL, so this should be ok.
(Line 593 of this file does that.)
Acked-by: MyungJoo Ham <myungjoo.ham@samsung.com>
(Applied to next-rc in devfreq tree)
(same applies to exynos-nocp commit as well)
Cheers,
MyungJoo
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable
2017-05-24 1:30 ` MyungJoo Ham
@ 2017-05-24 1:54 ` Chanwoo Choi
0 siblings, 0 replies; 4+ messages in thread
From: Chanwoo Choi @ 2017-05-24 1:54 UTC (permalink / raw)
To: myungjoo.ham, Arvind Yadav, Kyungmin Park, krzk@kernel.org,
kgene@kernel.org, javier@osg.samsung.com
Cc: linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org,
linux-samsung-soc@vger.kernel.org, linux-kernel@vger.kernel.org
On 2017년 05월 24일 10:30, MyungJoo Ham wrote:
>> On 2017년 05월 19일 19:56, Arvind Yadav wrote:
>>> clk_prepare_enable() can fail here and we must check its return value.
>>>
>>> Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
>>> ---
>>> drivers/devfreq/event/exynos-ppmu.c | 6 +++++-
>>> 1 file changed, 5 insertions(+), 1 deletion(-)
>>>
>>> diff --git a/drivers/devfreq/event/exynos-ppmu.c b/drivers/devfreq/event/exynos-ppmu.c
>>> index 9b73509..8f6537a 100644
>>> --- a/drivers/devfreq/event/exynos-ppmu.c
>>> +++ b/drivers/devfreq/event/exynos-ppmu.c
>>> @@ -648,7 +648,11 @@ static int exynos_ppmu_probe(struct platform_device *pdev)
>>> dev_name(&pdev->dev), desc[i].name);
>>> }
>>>
>>> - clk_prepare_enable(info->ppmu.clk);
>>> + ret = clk_prepare_enable(info->ppmu.clk);
>>> + if (ret) {
>>> + dev_err(&pdev->dev, "failed to prepare ppmu clock\n");
>>> + return ret;
>>> + }
>>
>> You're right. But, actually, some ppmu device-tree node doesn't include
>> the clock information because exynos clk driver don't support the
>> clock for some ppmu devices. Until now, the clock of ppmu devices
>> are default on state.
>
> If it does not include the clock information, info->ppmu.clk is NULL,
> which makes ret == NULL, so this should be ok.
> (Line 593 of this file does that.)
Ah.. You're right. I'm missing this point.
Looks good to me.
Acked-by: Chanwoo Choi <cw00.choi@samsung.com>
--
Best Regards,
Chanwoo Choi
Samsung Electronics
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2017-05-24 1:54 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <CGME20170519105745epcas5p29a5cbb259cd15138d7220f34e130e00a@epcas5p2.samsung.com>
2017-05-19 10:56 ` [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable Arvind Yadav
2017-05-23 9:41 ` Chanwoo Choi
2017-05-24 1:30 ` MyungJoo Ham
2017-05-24 1:54 ` Chanwoo Choi
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).