From patchwork Sat Nov 4 03:38:28 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10041409 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 811D160567 for ; Sat, 4 Nov 2017 03:38:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7627829A07 for ; Sat, 4 Nov 2017 03:38:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6ADA929ADA; Sat, 4 Nov 2017 03:38:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 203E829A07 for ; Sat, 4 Nov 2017 03:38:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751548AbdKDDie (ORCPT ); Fri, 3 Nov 2017 23:38:34 -0400 Received: from mail-pg0-f68.google.com ([74.125.83.68]:52344 "EHLO mail-pg0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751216AbdKDDid (ORCPT ); Fri, 3 Nov 2017 23:38:33 -0400 Received: by mail-pg0-f68.google.com with SMTP id a192so3995879pge.9 for ; Fri, 03 Nov 2017 20:38:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=0T063sKcLmiKc4kIpJn1sHSFq0XN5UvOELkKRFxa6jM=; b=YGi8i9O9qdVdlo/LnzqZeGgEMZlmj1R8WTP6/UxRHMn1QlaiUUlApaxLzyVlqr2Ylq 02tLULCpg1b5CiFjZ4/ZOHGzxD/DLdXWm4A2XAAW5xR2r6Lz/zzIe3Npog04B5j9SxO5 RUuZzkxO+OwZ4Zy6TMTbRWkEEyShsw/X3j7CE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=0T063sKcLmiKc4kIpJn1sHSFq0XN5UvOELkKRFxa6jM=; b=bw6I69MWLn9ok69QYgsRNF5g1///yezHtF2wAWu9uAa0oRozsLWsXQ69AMEXpFcI7r NXZf9FSI6MSi1XnAcuIpgjYBzCxFIXiW8J7al2rUGUIX3KqNVMgrb3RQHNsdl0D9VDuK Mw1olaeJL+5HJRFu/MqckutYctxdkfacfqPAMx+A58I1vdZxoQJdWF7NlpX/STkft+3G jLz0MuUr2vRGc3fuxQDorSY0P7VYppiaTkqF4WeHqApVtsmu3theTrb/L8dt01ZROZeA YsJkVER5w3hNocjXH/j1TaYAhi/7rqYQxov9pL09c5uWx0R2lZFZFvGamHgClgQBt5Sf TiCg== X-Gm-Message-State: AMCzsaV51qVEQk2IR7L293nrM59NIqbLoEpYFKXSJxDz24RGc2EqvXZ8 0OjZ6UvrO9NmlIPS5/1mCUjLsg== X-Google-Smtp-Source: ABhQp+TAZbp+fjYzf7O2NjtP30pb0MeZCP5ilSlNW90N94PtrsKZcR0+3hWrR9OJPXxkPpoe7ci6ug== X-Received: by 10.101.74.199 with SMTP id c7mr8909125pgu.169.1509766713015; Fri, 03 Nov 2017 20:38:33 -0700 (PDT) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id b22sm13333418pfj.123.2017.11.03.20.38.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Nov 2017 20:38:32 -0700 (PDT) From: Bjorn Andersson To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] PM / devfreq: Propagate error from devfreq_add_device() Date: Fri, 3 Nov 2017 20:38:28 -0700 Message-Id: <20171104033828.16773-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.12.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Propagate the error of devfreq_add_device() in devm_devfreq_add_device() rather than statically returning ENOMEM. This makes it slightly faster to pinpoint the cause of a returned error. Signed-off-by: Bjorn Andersson Acked-by: Chanwoo Choi Signed-off-by: Bjorn Andersson --- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/devfreq/devfreq.c b/drivers/devfreq/devfreq.c index 78fb496ecb4e..99c4021fc33b 100644 --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -737,7 +737,7 @@ struct devfreq *devm_devfreq_add_device(struct device *dev, devfreq = devfreq_add_device(dev, profile, governor_name, data); if (IS_ERR(devfreq)) { devres_free(ptr); - return ERR_PTR(-ENOMEM); + return devfreq; } *ptr = devfreq;