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: 118001 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2386502qgn; Sun, 5 Nov 2017 21:27:48 -0800 (PST) X-Google-Smtp-Source: ABhQp+RX0qCBCLI+PoAcbspwmQqRSwhlmtCD2Ma0YZssc0WCBvnIbo7xnn+xTHpbmB6zTo/J3FLG X-Received: by 10.84.192.37 with SMTP id b34mr13608126pld.451.1509946068210; Sun, 05 Nov 2017 21:27:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509946068; cv=none; d=google.com; s=arc-20160816; b=xvBlW9XOrjM7TR0ftxWA3Lm/1p8DaIpG6alIkeYQBiBhSfRdGAS26r01Kc/F8Hu5IW L0U9HR2bGtvcXRylDxBuo3v0JISxX8XJQXpUoCeJUf5KHrEAGgs/1WjMRtWGrJdT8Uqk wH3tzdJAceoXDW/a3P3xGFcHyBaFlfRhd6SUfLscyZAQqGDKxfguzNzULFA/qeQXkM+G QA/7ZQKor6ZORgESj+8KFJj8o8hLo4mtgWqvD+zcFb9+JvYEdIWyHXy882WYRxQ+kCtp uK5FyhXRQrkZX0TrpCD6nwKZCSAztvRhbZPoCNjdTL8cgW8Dl4ExFx8mUooYxlci0nop HYHw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=h/eImyQTEui/oKQwy69bZx7CPXj3pB5SlWqwdtNEZaM=; b=YnwKAWMxQTRUvpsYGZ8Huw9cPJHVTbGDsoEeOoETmd4YnNcTeJnB4Ox0mUG5ORsxxY dx0nTH5vzrGg4i1RPE/XHlRzILEjeVyuQVN2nwkwg5eX3F0FEl1cZP1K7Rq01LtamfMl v/TVDvUeSP0JsNHgkyo5qjvMuDk9ZKf3vDz7p80PW5cIpdydHOH/MB7Z3EhSBdfRZ/Cd 9sLD4A3jZ/Cawn88VhD2xQi28wpxQrFyKalRv2QNuzvsAoXUrhISVScv3BxkwARzo9nx 0H9ZqzsBFG26Yg1RH5THPpk13lhJ6TZOZjdu0uSaPjAr9VIFKT1OXo+O/ToIWvEMnyvs HH2Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MRsmadb4; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id i3si9563058pli.199.2017.11.05.21.27.47; Sun, 05 Nov 2017 21:27:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MRsmadb4; spf=pass (google.com: best guess record for domain of linux-pm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-pm-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751035AbdKFF1q (ORCPT + 11 others); 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-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 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 --- Resending with Chanwoo's ack, Fixes and Cc stable drivers/devfreq/devfreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.12.0 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;