Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp2371696imm; Thu, 7 Jun 2018 09:30:57 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIFNKtDiIC2JHJJy+6XOzIy1GT+iiZp8KcGa83dzT+ofavg2OqCxzYOLrXk705lvZQdLsSV X-Received: by 2002:a63:7255:: with SMTP id c21-v6mr2077048pgn.99.1528389057197; Thu, 07 Jun 2018 09:30:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1528389057; cv=none; d=google.com; s=arc-20160816; b=Xff01vJIsCJvzXRRuB91QECYc9zrQdfF5F4Sde4diWJyKBnVY+PJbFftvDA9h42EVJ xef7VHxWXp7fK9y5qkTGZCI+rFCCo4ejPv8E8ebAE1sCspOfvPpLpxUTCI0fp5t6gIad lHEd1trxaaWGQziwaRo2lkgTNxdoreKcrjWpGgYbdVcjXg7857AvleHVCkmNobNetWyi qcLwTfStGEqJoPq02jWpNBR2hMjJl386h+w3UIbnMn5QlMQ3Ibyj8z0sJdIG4AxfC2WG gbO3iwjkCpgbNi38DQFcFfYLU6gZ2VpYnuXmuiEEkWFVRElfwuORxEkvgeXukqOG/3zl Ra9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:subject:message-id:date:cc:to :from:mime-version:content-transfer-encoding:content-disposition :arc-authentication-results; bh=sJ8rfU3OuThi3r7QABFgtLI34kPr1Z+mvHFH3ERE/fg=; b=gfs/QyIR2TjWrsuPW+bv0rv0Kb0x6Rb7EoR2oyt7hpgAFkZce9y0EzTLAqj7pmsh4m dW6B+Go2+aI2dgg7kN0SOAByNQ5Nav6M4qTtgFOrRZgEBCvwYaUxmYWd42FyFlqgkI1t 9N9BnXsFE9/LCj8SY6AhTHPNHTFQ0l/fIkEdufvtJu1aEOK9Cuwr5LaC1rV2Gy93X+oo sKyG9P4QCDw+43VFMi+YZzkJOprU/RfDq3OiIwhX34E7P2hxRjBbQuDG+j9hZYKysPwJ oqykWRqibJS90Ms/wrY2ran6prWG6Rh9HfcCm9YfDFZElLkJjGWAihzIaWrRRzXM3jh2 XhgA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bg2-v6si29356708plb.243.2018.06.07.09.30.42; Thu, 07 Jun 2018 09:30:57 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933135AbeFGOJ0 (ORCPT + 99 others); Thu, 7 Jun 2018 10:09:26 -0400 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:39235 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933005AbeFGOJE (ORCPT ); Thu, 7 Jun 2018 10:09:04 -0400 Received: from [148.252.241.226] (helo=deadeye) by shadbolt.decadent.org.uk with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1fQvb4-0005Zo-9g; Thu, 07 Jun 2018 15:09:02 +0100 Received: from ben by deadeye with local (Exim 4.91) (envelope-from ) id 1fQvb1-0002oi-2d; Thu, 07 Jun 2018 15:08:59 +0100 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "Chanwoo Choi" , "Bjorn Andersson" , "MyungJoo Ham" Date: Thu, 07 Jun 2018 15:05:21 +0100 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 093/410] PM / devfreq: Propagate error from devfreq_add_device() In-Reply-To: X-SA-Exim-Connect-IP: 148.252.241.226 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 3.16.57-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: Bjorn Andersson commit d1bf2d30728f310f72296b54f0651ecdb09cbb12 upstream. 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. Fixes: 8cd84092d35e ("PM / devfreq: Add resource-managed function for devfreq device") Acked-by: Chanwoo Choi Signed-off-by: Bjorn Andersson Signed-off-by: MyungJoo Ham Signed-off-by: Ben Hutchings --- drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/devfreq/devfreq.c +++ b/drivers/devfreq/devfreq.c @@ -592,7 +592,7 @@ struct devfreq *devm_devfreq_add_device( devfreq = devfreq_add_device(dev, profile, governor_name, data); if (IS_ERR(devfreq)) { devres_free(ptr); - return ERR_PTR(-ENOMEM); + return devfreq; } *ptr = devfreq;