From patchwork Sun Aug 5 20:25:08 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heiko Stuebner X-Patchwork-Id: 1275661 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork2.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork2.kernel.org (Postfix) with ESMTP id B3B46DF27F for ; Sun, 5 Aug 2012 20:26:12 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754948Ab2HEUZU (ORCPT ); Sun, 5 Aug 2012 16:25:20 -0400 Received: from gloria.sntech.de ([95.129.55.99]:33285 "EHLO gloria.sntech.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752823Ab2HEUZT (ORCPT ); Sun, 5 Aug 2012 16:25:19 -0400 Received: from 146-52-33-138-dynip.superkabel.de ([146.52.33.138] helo=marty.localnet) by gloria.sntech.de with esmtpsa (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.72) (envelope-from ) id 1Sy7Nu-0002ZU-LC; Sun, 05 Aug 2012 22:25:10 +0200 From: Heiko =?utf-8?q?St=C3=BCbner?= To: Len Brown , Pavel Machek , "Rafael J. Wysocki" , "Greg Kroah-Hartman" Subject: [PATCH] PM / Domains: Only check for errors when calling dev_pm_get_subsys_data Date: Sun, 5 Aug 2012 22:25:08 +0200 User-Agent: KMail/1.13.7 (Linux/3.2.0-3-686-pae; KDE/4.8.4; i686; ; ) Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Message-Id: <201208052225.09503.heiko@sntech.de> Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org Commit 1d5fcfec22 (PM / Domains: Add device domain data reference counter) added a check for the return value of dev_pm_get_subsys_data. But this function does not only return error codes but also "1" when a new object has been created. So, change the check to only catch real errors. Signed-off-by: Heiko Stuebner --- against 3.6-rc1 drivers/base/power/domain.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index ba3487c..5959fcb 100644 --- a/drivers/base/power/domain.c +++ b/drivers/base/power/domain.c @@ -1323,7 +1323,7 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, } ret = dev_pm_get_subsys_data(dev); - if (ret) + if (ret < 0) goto out; genpd->device_count++;