From patchwork Mon Oct 17 18:17:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 77796 Delivered-To: patches@linaro.org Received: by 10.140.97.247 with SMTP id m110csp517993qge; Mon, 17 Oct 2016 11:17:16 -0700 (PDT) X-Received: by 10.25.198.9 with SMTP id w9mr16779017lff.164.1476728236741; Mon, 17 Oct 2016 11:17:16 -0700 (PDT) Return-Path: Received: from mail-lf0-x22c.google.com (mail-lf0-x22c.google.com. [2a00:1450:4010:c07::22c]) by mx.google.com with ESMTPS id p11si612684lfd.138.2016.10.17.11.17.16 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 17 Oct 2016 11:17:16 -0700 (PDT) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22c as permitted sender) client-ip=2a00:1450:4010:c07::22c; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org; spf=pass (google.com: domain of ulf.hansson@linaro.org designates 2a00:1450:4010:c07::22c as permitted sender) smtp.mailfrom=ulf.hansson@linaro.org; dmarc=pass (p=NONE dis=NONE) header.from=linaro.org Received: by mail-lf0-x22c.google.com with SMTP id l131so253152167lfl.2 for ; Mon, 17 Oct 2016 11:17:16 -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:in-reply-to:references; bh=SrAXtbC9GwTmtfBtKRlvcLWC8qL9bNz949b3cRr8h0M=; b=XWSR8HulsHrYjT2frVmvXosErHzVp/cB5wuKqOlb1K1RgA54Z2zXfIgDDrNDziOQQK PdjtQhgP52Q6p6VahnNNXJJ0Qfboz1NvcMxCStHq0iRCHtnSozboeWZ/rg3zzp02tkkk LTUJGUPyk0RTIrqUsUq40wt7l2h6nrmNAi1nw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=SrAXtbC9GwTmtfBtKRlvcLWC8qL9bNz949b3cRr8h0M=; b=WyI4FdW9SGG2NsDxLBst32uaHhmBc429V4T9FHidHbPi5MEOgG/KAN8qn+spJVmn8F S8B21bkG677Fk6OVUszyZ3h7AV1XwVYCGHL6TKlRJWYbj+mClfNCG1uwtTx0M9TLDpPZ oC0VoWLXjLgNRoVl2YOEe80jHiQ3ZKzNW+GJ7uUNgwIsdMEI4GADFMiU8VRFPIj7Sqtp yU/SM1LtHir5hgiEutL1m0t/qGHoL4/OkRmZ/vYf86M0ni8jTuVycw4B6A7OLLFJulTI HhgWMW3LJNoIYry6a3rOKnY3su3de5FiSrn0o9DL9Sqze2rbj5UKnKuRNPtLAE7GwlWV x2zg== X-Gm-Message-State: AA6/9RmzMrbCrvCju31e4fU7FDK0zTWDWE74Pem9P5Hv/0mtLNEN6ez8SgihnexSKwHyzMMjLQQ= X-Received: by 10.25.221.209 with SMTP id w78mr14765500lfi.141.1476728236049; Mon, 17 Oct 2016 11:17:16 -0700 (PDT) Return-Path: Received: from localhost.localdomain (h-155-4-221-67.na.cust.bahnhof.se. [155.4.221.67]) by smtp.gmail.com with ESMTPSA id r20sm8230251lfr.19.2016.10.17.11.17.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 17 Oct 2016 11:17:15 -0700 (PDT) From: Ulf Hansson To: "Rafael J. Wysocki" , Alan Stern , Ulf Hansson , linux-pm@vger.kernel.org Cc: Len Brown , Pavel Machek , Kevin Hilman , Geert Uytterhoeven , Lina Iyer , Jon Hunter , Marek Szyprowski , Linus Walleij Subject: [PATCH 3/4] PM / Runtime: Convert pm_runtime_set_suspended() to return an int Date: Mon, 17 Oct 2016 20:17:00 +0200 Message-Id: <1476728221-26530-4-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1476728221-26530-1-git-send-email-ulf.hansson@linaro.org> References: <1476728221-26530-1-git-send-email-ulf.hansson@linaro.org> Because pm_runtime_set_suspended() invokes __pm_runtime_set_status(), which can fail, pm_runtime_set_suspended() can also fail. Instead of hiding a potential error, let's propagate it by converting pm_runtime_set_suspended() from a void to return an int. In this way users are able to check the error code and act accordingly. Signed-off-by: Ulf Hansson --- include/linux/pm_runtime.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) -- 1.9.1 Reviewed-by: Linus Walleij diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h index 61ea566..4957fc1 100644 --- a/include/linux/pm_runtime.h +++ b/include/linux/pm_runtime.h @@ -258,9 +258,9 @@ static inline int pm_runtime_set_active(struct device *dev) return __pm_runtime_set_status(dev, RPM_ACTIVE); } -static inline void pm_runtime_set_suspended(struct device *dev) +static inline int pm_runtime_set_suspended(struct device *dev) { - __pm_runtime_set_status(dev, RPM_SUSPENDED); + return __pm_runtime_set_status(dev, RPM_SUSPENDED); } static inline void pm_runtime_disable(struct device *dev)