Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1645511 > unrolled thread

[PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable

Started byArvind Yadav <arvind.yadav.cs@gmail.com>
First post2017-05-19 13:00 +0200
Last post2017-05-24 04:00 +0200
Articles 4 — 3 participants

Back to article view | Back to linux.kernel


Contents

  [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable Arvind Yadav <arvind.yadav.cs@gmail.com> - 2017-05-19 13:00 +0200
    Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of  clk_prepare_enable Chanwoo Choi <cw00.choi@samsung.com> - 2017-05-23 11:50 +0200
      RE: Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value  of clk_prepare_enable MyungJoo Ham <myungjoo.ham@samsung.com> - 2017-05-24 03:40 +0200
        Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of  clk_prepare_enable Chanwoo Choi <cw00.choi@samsung.com> - 2017-05-24 04:00 +0200

#1645511 — [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable

FromArvind Yadav <arvind.yadav.cs@gmail.com>
Date2017-05-19 13:00 +0200
Subject[PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable
Message-ID<tINNw-Zy-7@gated-at.bofh.it>
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

[toc] | [next] | [standalone]


#1647899 — Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-05-23 11:50 +0200
SubjectRe: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable
Message-ID<tKeBY-1li-9@gated-at.bofh.it>
In reply to#1645511
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

[toc] | [prev] | [next] | [standalone]


#1649050 — RE: Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable

FromMyungJoo Ham <myungjoo.ham@samsung.com>
Date2017-05-24 03:40 +0200
SubjectRE: Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable
Message-ID<tKtrj-3pO-9@gated-at.bofh.it>
In reply to#1647899
> 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

[toc] | [prev] | [next] | [standalone]


#1649056 — Re: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable

FromChanwoo Choi <cw00.choi@samsung.com>
Date2017-05-24 04:00 +0200
SubjectRe: [PATCH v1] PM / devfreq: exynos-ppmu : Handle return value of clk_prepare_enable
Message-ID<tKtKF-3yx-7@gated-at.bofh.it>
In reply to#1649050
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

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web