diff mbox

cpufreq: OMAP: Check IS_ERR() instead of NULL for omap_device_get_by_hwmod_name

Message ID 1347932747.6562.3.camel@phoenix (mailing list archive)
State New, archived
Headers show

Commit Message

axel lin Sept. 18, 2012, 1:45 a.m. UTC
omap_device_get_by_hwmod_name() returns ERR_PTR on error.

Signed-off-by: Axel Lin <axel.lin@gmail.com>
---
 drivers/cpufreq/omap-cpufreq.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Rafael Wysocki Sept. 18, 2012, 6:52 p.m. UTC | #1
On Tuesday, September 18, 2012, Axel Lin wrote:
> omap_device_get_by_hwmod_name() returns ERR_PTR on error.
> 
> Signed-off-by: Axel Lin <axel.lin@gmail.com>

Kevin, should I take this?

Rafael


> ---
>  drivers/cpufreq/omap-cpufreq.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
> index 6e22f44..65f8e9a 100644
> --- a/drivers/cpufreq/omap-cpufreq.c
> +++ b/drivers/cpufreq/omap-cpufreq.c
> @@ -266,9 +266,9 @@ static int __init omap_cpufreq_init(void)
>  	}
>  
>  	mpu_dev = omap_device_get_by_hwmod_name("mpu");
> -	if (!mpu_dev) {
> +	if (IS_ERR(mpu_dev)) {
>  		pr_warning("%s: unable to get the mpu device\n", __func__);
> -		return -EINVAL;
> +		return PTR_ERR(mpu_dev);
>  	}
>  
>  	mpu_reg = regulator_get(mpu_dev, "vcc");
> 

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Kevin Hilman Sept. 19, 2012, 4:51 p.m. UTC | #2
"Rafael J. Wysocki" <rjw@sisk.pl> writes:

> On Tuesday, September 18, 2012, Axel Lin wrote:
>> omap_device_get_by_hwmod_name() returns ERR_PTR on error.
>> 
>> Signed-off-by: Axel Lin <axel.lin@gmail.com>
>
> Kevin, should I take this?

Yes, please.

Acked-by: Kevin Hilman <khilman@ti.com>

Thanks,

Kevin


--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Rafael Wysocki Sept. 19, 2012, 8:17 p.m. UTC | #3
On Wednesday, September 19, 2012, Kevin Hilman wrote:
> "Rafael J. Wysocki" <rjw@sisk.pl> writes:
> 
> > On Tuesday, September 18, 2012, Axel Lin wrote:
> >> omap_device_get_by_hwmod_name() returns ERR_PTR on error.
> >> 
> >> Signed-off-by: Axel Lin <axel.lin@gmail.com>
> >
> > Kevin, should I take this?
> 
> Yes, please.
> 
> Acked-by: Kevin Hilman <khilman@ti.com>

Done.

Thanks,
Rafael
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/cpufreq/omap-cpufreq.c b/drivers/cpufreq/omap-cpufreq.c
index 6e22f44..65f8e9a 100644
--- a/drivers/cpufreq/omap-cpufreq.c
+++ b/drivers/cpufreq/omap-cpufreq.c
@@ -266,9 +266,9 @@  static int __init omap_cpufreq_init(void)
 	}
 
 	mpu_dev = omap_device_get_by_hwmod_name("mpu");
-	if (!mpu_dev) {
+	if (IS_ERR(mpu_dev)) {
 		pr_warning("%s: unable to get the mpu device\n", __func__);
-		return -EINVAL;
+		return PTR_ERR(mpu_dev);
 	}
 
 	mpu_reg = regulator_get(mpu_dev, "vcc");