From patchwork Mon Nov 6 05:27:41 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 10042611 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 44C4D601EB for ; Mon, 6 Nov 2017 05:27:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FE7A295E9 for ; Mon, 6 Nov 2017 05:27:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2305229604; Mon, 6 Nov 2017 05:27: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=-6.5 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RCVD_IN_SORBS_SPAM autolearn=ham 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 1664A295E9 for ; Mon, 6 Nov 2017 05:27:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751035AbdKFF1q (ORCPT ); Mon, 6 Nov 2017 00:27:46 -0500 Received: from mail-pf0-f196.google.com ([209.85.192.196]:49558 "EHLO mail-pf0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750888AbdKFF1q (ORCPT ); Mon, 6 Nov 2017 00:27:46 -0500 Received: by mail-pf0-f196.google.com with SMTP id i5so6925539pfe.6 for ; Sun, 05 Nov 2017 21:27:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=h/eImyQTEui/oKQwy69bZx7CPXj3pB5SlWqwdtNEZaM=; b=MRsmadb4Tis5wo3xcEX4rBsnBGhDEYRoiLkP1vglpjTPxwNBTb1lMmc7cwfzHIw2WA 7GwcTRGWQh9ft3LK0JWQMFrHsn+kS7ymh8Y27BiR3MdYUT/pk/4/NO2W2DmknrfFRbzH 8i2c5NbQMfRwNgiiDLHBuZUYdu/8FbchImlYo= 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=h/eImyQTEui/oKQwy69bZx7CPXj3pB5SlWqwdtNEZaM=; b=jT+C89KRgb3ZbTD1VAOC4FQx/45YQ+Rp1oQ8QZKUpBmwGUISznUs15KV6JtZlUZn06 eVy0V1bAxug3kYJ6Is6d5R1Jh31QFHXqBy5gHULXl/ddHIp844BIeSGp/oZ0RTy10Lau ljfxcnzKVMhLQWfFWKkLwNVRlxOrpJc9wCNdE/jdFH6BnfSvjbs5ASsRa72XmGDHUhHr D7qVbCirkd4+pC4yNxYa/VeXO54mIz4DZ4QRLp3mNsk32QGjGMumXOjv08F8z3emR1L+ 2VTJvovyEh9Pm4tX9ySDW4MsGSNbJI37zlCxHx8f5Cuqpsn93qZ3pANRWVejhSze0XhA HqsQ== X-Gm-Message-State: AMCzsaUwLh15lFfQZUeIrogwgYRAIi9q4h2fc4/jnuvplcZnBvRE3QOD oaakQ0BpMcn1KtnEMBgDXCnMlg== X-Google-Smtp-Source: ABhQp+SeUEMXRWknYmPnSAnh/iU0YL1P8+B0BAUCm7cs3JAzceRcigk2k/P+1WKjtBAn0BXCvbRi5Q== X-Received: by 10.98.16.211 with SMTP id 80mr15466890pfq.72.1509946065400; Sun, 05 Nov 2017 21:27:45 -0800 (PST) Received: from localhost.localdomain (ip68-111-217-79.sd.sd.cox.net. [68.111.217.79]) by smtp.gmail.com with ESMTPSA id b9sm20880057pff.48.2017.11.05.21.27.44 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 05 Nov 2017 21:27:44 -0800 (PST) From: Bjorn Andersson To: MyungJoo Ham , Kyungmin Park , Chanwoo Choi Cc: linux-pm@vger.kernel.org, stable@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] PM / devfreq: Propagate error from devfreq_add_device() Date: Sun, 5 Nov 2017 21:27:41 -0800 Message-Id: <20171106052741.445-1-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.15.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. Fixes: 8cd84092d35e ("PM / devfreq: Add resource-managed function for devfreq device") Cc: stable@vger.kernel.org Acked-by: Chanwoo Choi Signed-off-by: Bjorn Andersson Acked-by: MyungJoo Ham --- Resending with Chanwoo's ack, Fixes and Cc stable 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;