From patchwork Tue Aug 7 09:04:16 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tushar Behera X-Patchwork-Id: 10555 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 45E0B23E57 for ; Tue, 7 Aug 2012 09:05:44 +0000 (UTC) Received: from mail-yx0-f180.google.com (mail-yx0-f180.google.com [209.85.213.180]) by fiordland.canonical.com (Postfix) with ESMTP id EA217A1814F for ; Tue, 7 Aug 2012 09:05:43 +0000 (UTC) Received: by yenq6 with SMTP id q6so3436046yen.11 for ; Tue, 07 Aug 2012 02:05:43 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-forwarded-to:x-forwarded-for:delivered-to:received-spf:from:to:cc :subject:date:message-id:x-mailer:x-gm-message-state; bh=PpLQbh7yAW66z8fxCzjsbBe4Eq5Q/joS2M71w5zsxbY=; b=HbWPk4DTnKuvPtVcv5MBw8dzoQMFObl2QcvXpPvqj1nZ+kQb9pSrr51h15+2w4C/HD 7HoUK6qYHob6p9dMZCAjn+ZKJHw3Pjb0qDFMGivudNfsPeZWDWxfUeWAdDlD25Wy7R3f IdYXiwn2u6gAaVXgCC2jl1FNGxlAFmsfb5wm8l2End5B7ypOC7HIX4n3nckOveys8L1d Tczh2SxTrVQmH52LLZsOQMmA/T1+oBB6rdzct1KrbUybYCxQmAJVoH78AUijjwAcn7xl /lP3DxraB7/65K5e7ZoQCKiOf+cfx9a/JdvlPs+5Q9TfmCublPpD4AaQkot66XJWBtRg seEg== Received: by 10.50.187.130 with SMTP id fs2mr289256igc.51.1344330343106; Tue, 07 Aug 2012 02:05:43 -0700 (PDT) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.50.87.40 with SMTP id u8csp486627igz; Tue, 7 Aug 2012 02:05:42 -0700 (PDT) Received: by 10.68.240.73 with SMTP id vy9mr26045692pbc.156.1344330342056; Tue, 07 Aug 2012 02:05:42 -0700 (PDT) Received: from mail-pb0-f50.google.com (mail-pb0-f50.google.com [209.85.160.50]) by mx.google.com with ESMTPS id qd2si24788541pbb.147.2012.08.07.02.05.41 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Aug 2012 02:05:42 -0700 (PDT) Received-SPF: neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) client-ip=209.85.160.50; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.160.50 is neither permitted nor denied by best guess record for domain of tushar.behera@linaro.org) smtp.mail=tushar.behera@linaro.org Received: by pbcmd12 with SMTP id md12so5995273pbc.37 for ; Tue, 07 Aug 2012 02:05:41 -0700 (PDT) Received: by 10.68.219.65 with SMTP id pm1mr1409584pbc.121.1344330341502; Tue, 07 Aug 2012 02:05:41 -0700 (PDT) Received: from localhost.localdomain ([115.113.119.130]) by mx.google.com with ESMTPS id qd2sm10796699pbb.29.2012.08.07.02.05.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 07 Aug 2012 02:05:40 -0700 (PDT) From: Tushar Behera To: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Cc: len.brown@intel.com, pavel@ucw.cz, rjw@sisk.pl, patches@linaro.org Subject: [PATCH] PM / Domains: Not return error when dev_pm_get_subsys_data returns 1 Date: Tue, 7 Aug 2012 14:34:16 +0530 Message-Id: <1344330256-6939-1-git-send-email-tushar.behera@linaro.org> X-Mailer: git-send-email 1.7.4.1 X-Gm-Message-State: ALoCoQnIM2gT2+2OAq6/KTt5if5ApB8fHl3UmgrqfkKD8+OfKWST5U6jvSybRIx1NqMpwwxXSoGq Commit 1d5fcfec22 ("PM / Domains: Add device domain data reference counter") returns error when dev_pm_get_subsys_data() returns a non-zero value. However, dev_pm_get_subsys_data() returns 1 when dev->power.subsys_data is allocated during this call. Hence we should only check for the error codes in the return value. Without this patch, following errors are encountered while adding devices to powerdomain on Origen board (based on EXYNOS4210). exynos_pm_add_dev_to_genpd: error in adding exynos4-fb.0 device to pd-lcd0 powerdomain Signed-off-by: Tushar Behera --- drivers/base/power/domain.c | 4 ++-- 1 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/base/power/domain.c b/drivers/base/power/domain.c index ba3487c..f6802cb 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++; @@ -1358,7 +1358,7 @@ int __pm_genpd_add_device(struct generic_pm_domain *genpd, struct device *dev, if (gpd_data != gpd_data_new) __pm_genpd_free_dev_data(dev, gpd_data_new); - return ret; + return (ret < 0) ? : 0; } /**