diff mbox

PM / devfreq: create_freezable_workqueue() doesn't return an ERR_PTR

Message ID 20130815075509.GB19280@elgon.mountain (mailing list archive)
State Not Applicable, archived
Headers show

Commit Message

Dan Carpenter Aug. 15, 2013, 7:55 a.m. UTC
The create_freezable_workqueue() function returns a NULL on error and
not an ERR_PTR.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

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

Comments

MyungJoo Ham Aug. 19, 2013, 4:49 a.m. UTC | #1
On Thu, Aug 15, 2013 at 4:55 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>
> The create_freezable_workqueue() function returns a NULL on error and
> not an ERR_PTR.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Thanks. I'll apply this.

Signed-off-by: MyungJoo Ham <myungjoo.ham@samsung.com>

>
> diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
> index e94e619..5088523 100644
> --- a/drivers/devfreq/devfreq.c
> +++ b/drivers/devfreq/devfreq.c
> @@ -983,10 +983,10 @@ static int __init devfreq_init(void)
>         }
>
>         devfreq_wq = create_freezable_workqueue("devfreq_wq");
> -       if (IS_ERR(devfreq_wq)) {
> +       if (!devfreq_wq) {
>                 class_destroy(devfreq_class);
>                 pr_err("%s: couldn't create workqueue\n", __FILE__);
> -               return PTR_ERR(devfreq_wq);
> +               return -ENOMEM;
>         }
>         devfreq_class->dev_attrs = devfreq_attrs;
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html




--
MyungJoo Ham, Ph.D.
System S/W Lab, S/W Center, Samsung Electronics
--
To unsubscribe from this list: send the line "unsubscribe linux-pm" 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/devfreq/devfreq.c b/drivers/devfreq/devfreq.c
index e94e619..5088523 100644
--- a/drivers/devfreq/devfreq.c
+++ b/drivers/devfreq/devfreq.c
@@ -983,10 +983,10 @@  static int __init devfreq_init(void)
 	}
 
 	devfreq_wq = create_freezable_workqueue("devfreq_wq");
-	if (IS_ERR(devfreq_wq)) {
+	if (!devfreq_wq) {
 		class_destroy(devfreq_class);
 		pr_err("%s: couldn't create workqueue\n", __FILE__);
-		return PTR_ERR(devfreq_wq);
+		return -ENOMEM;
 	}
 	devfreq_class->dev_attrs = devfreq_attrs;