From patchwork Thu Jan 29 17:39:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ulf Hansson X-Patchwork-Id: 43955 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id C56952410D for ; Thu, 29 Jan 2015 17:39:18 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id b6sf22662632lbj.0 for ; Thu, 29 Jan 2015 09:39:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=TZw+M6PgnOJPnq7iFEHdkMshg+Vh2OlW35uK3kNmURU=; b=LlK7cu+bgl8lTnlF29ClXZfzSw7FX9v9aV5aXMd4Uw70DJcRkSsryhU1rPuXPTeq0U 2GxkqMTgFnCIyNXKo3EeNGIydyd2RdZEH2UQj81yUYMvs22eUvsk2dHDFm7DR0NW29iE tIDJ9H7OVPbaTKn6I9vGabJArHONCJpqqjrcN+ayc9LwxNfpmJF0qvFnE3NffKRFD0k+ TIugSZUnx85B2/GZZGo2iIpE2J4Do5yZ0ielbvHxfo5l7YmQiAncLqKuHl7LmhGrsbYi 3bsL6V9Z4tHcPt3nDybGcIZhC4ngCKqiejvNGhZJUG9Z1an/8LteUfBZzR00USHO8QFZ s06A== X-Gm-Message-State: ALoCoQkdyDPEhgG7Y1bYvDpk798Y7Z3NsVPz/7miswCI/kIL2b4RORz54POO2nu4KIw6bVX14v7l X-Received: by 10.152.219.136 with SMTP id po8mr283913lac.4.1422553157392; Thu, 29 Jan 2015 09:39:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.206.37 with SMTP id ll5ls360768lac.53.gmail; Thu, 29 Jan 2015 09:39:17 -0800 (PST) X-Received: by 10.112.181.165 with SMTP id dx5mr2123879lbc.89.1422553157190; Thu, 29 Jan 2015 09:39:17 -0800 (PST) Received: from mail-lb0-f180.google.com (mail-lb0-f180.google.com. [209.85.217.180]) by mx.google.com with ESMTPS id f4si8022156lbc.110.2015.01.29.09.39.17 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 09:39:17 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) client-ip=209.85.217.180; Received: by mail-lb0-f180.google.com with SMTP id b6so30695738lbj.11 for ; Thu, 29 Jan 2015 09:39:17 -0800 (PST) X-Received: by 10.112.135.196 with SMTP id pu4mr2223397lbb.41.1422553157064; Thu, 29 Jan 2015 09:39:17 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp21124lbj; Thu, 29 Jan 2015 09:39:16 -0800 (PST) X-Received: by 10.112.137.196 with SMTP id qk4mr2237359lbb.33.1422553156635; Thu, 29 Jan 2015 09:39:16 -0800 (PST) Received: from mail-lb0-f178.google.com (mail-lb0-f178.google.com. [209.85.217.178]) by mx.google.com with ESMTPS id ml8si8054109lbc.77.2015.01.29.09.39.16 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Thu, 29 Jan 2015 09:39:16 -0800 (PST) Received-SPF: pass (google.com: domain of ulf.hansson@linaro.org designates 209.85.217.178 as permitted sender) client-ip=209.85.217.178; Received: by mail-lb0-f178.google.com with SMTP id u10so30722589lbd.9 for ; Thu, 29 Jan 2015 09:39:16 -0800 (PST) X-Received: by 10.112.130.34 with SMTP id ob2mr2325730lbb.78.1422553156508; Thu, 29 Jan 2015 09:39:16 -0800 (PST) Received: from uffe-Latitude-E6430s.lan (90-231-160-185-no158.tbcn.telia.com. [90.231.160.185]) by mx.google.com with ESMTPSA id rv1sm2233164lbb.25.2015.01.29.09.39.13 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 29 Jan 2015 09:39:14 -0800 (PST) From: Ulf Hansson To: "Rafael J. Wysocki" , Len Brown , Pavel Machek , linux-pm@vger.kernel.org Cc: Kevin Hilman , Geert Uytterhoeven , Ulf Hansson Subject: [PATCH 2/2] PM: Convert dev_pm_put_subsys_data() into a void function Date: Thu, 29 Jan 2015 18:39:05 +0100 Message-Id: <1422553145-14798-2-git-send-email-ulf.hansson@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1422553145-14798-1-git-send-email-ulf.hansson@linaro.org> References: <1422553145-14798-1-git-send-email-ulf.hansson@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: ulf.hansson@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.180 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Clients using the dev_pm_put_subsys_data() API isn't interested of a return value. They care only of decreasing a reference to the device's pm_subsys_data. So, let's convert the API to a void function, which anyway seems like reasonable thing to do. Signed-off-by: Ulf Hansson --- drivers/base/power/common.c | 14 ++++---------- include/linux/pm.h | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/base/power/common.c b/drivers/base/power/common.c index a1ee51d..f32b802 100644 --- a/drivers/base/power/common.c +++ b/drivers/base/power/common.c @@ -56,13 +56,11 @@ EXPORT_SYMBOL_GPL(dev_pm_get_subsys_data); * @dev: Device to handle. * * If the reference counter of power.subsys_data is zero after dropping the - * reference, power.subsys_data is removed. Return 1 if that happens or 0 - * otherwise. + * reference, power.subsys_data is removed. */ -int dev_pm_put_subsys_data(struct device *dev) +void dev_pm_put_subsys_data(struct device *dev) { struct pm_subsys_data *psd; - int ret = 1; spin_lock_irq(&dev->power.lock); @@ -70,18 +68,14 @@ int dev_pm_put_subsys_data(struct device *dev) if (!psd) goto out; - if (--psd->refcount == 0) { + if (--psd->refcount == 0) dev->power.subsys_data = NULL; - } else { + else psd = NULL; - ret = 0; - } out: spin_unlock_irq(&dev->power.lock); kfree(psd); - - return ret; } EXPORT_SYMBOL_GPL(dev_pm_put_subsys_data); diff --git a/include/linux/pm.h b/include/linux/pm.h index 8b59763..e2f1be6 100644 --- a/include/linux/pm.h +++ b/include/linux/pm.h @@ -597,7 +597,7 @@ struct dev_pm_info { extern void update_pm_runtime_accounting(struct device *dev); extern int dev_pm_get_subsys_data(struct device *dev); -extern int dev_pm_put_subsys_data(struct device *dev); +extern void dev_pm_put_subsys_data(struct device *dev); /* * Power domains provide callbacks that are executed during system suspend,