From patchwork Thu Feb 18 17:29:33 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 62220 Delivered-To: patch@linaro.org Received: by 10.112.43.199 with SMTP id y7csp713675lbl; Thu, 18 Feb 2016 09:30:01 -0800 (PST) X-Received: by 10.98.0.194 with SMTP id 185mr11708803pfa.139.1455816601755; Thu, 18 Feb 2016 09:30:01 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id us7si10439604pac.204.2016.02.18.09.30.01; Thu, 18 Feb 2016 09:30:01 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-arm-msm-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-arm-msm-owner@vger.kernel.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1946982AbcBRRaA (ORCPT + 7 others); Thu, 18 Feb 2016 12:30:00 -0500 Received: from mail-pa0-f54.google.com ([209.85.220.54]:36380 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1946429AbcBRR37 (ORCPT ); Thu, 18 Feb 2016 12:29:59 -0500 Received: by mail-pa0-f54.google.com with SMTP id yy13so34237027pab.3 for ; Thu, 18 Feb 2016 09:29:58 -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:in-reply-to:references; bh=ezX80RCK0dwOt88n5Jf6KHyr5XFzBWqD0kPPCCjXxG4=; b=POt84wUtP1mJnAc7dcCmXEv9LOfNaT/KDuozMvw6onkE1ST76JotKCaADF+2VaXyMD hwBis6r9c3psyaxhH68kgg5SWQmcbkxBEy2eHeu2fdPcNUF9z4kdCIH6F5P/++5crL3P w0Iw5a/s+N6yp3reXkXtqbVEy2ByIaInS5EA0= 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=ezX80RCK0dwOt88n5Jf6KHyr5XFzBWqD0kPPCCjXxG4=; b=dtTYYIR0FdX9T4XPtSDM7tUWeu4dTEJHEYlnqLEEi9PppgLJ/3X+04001No4Y3G9P2 JsfNCcvcA4sdjQwSEZbX2QyLjSi1S7Yuve0MKuqqyHMF3pZ/zPM+63N4BTykp5OkI1X6 IVwqCMtMOQEahAH2yThGlb/wK90uJt33OCo5tjUbidHHQcn3hC6CNiHXA3LnYcxDh2co JV0JdS35P1ma5jPeBDNbEGRVZzHUDn+VI78B2ywGX1wmeDYzBNFnCiFMh7vq2Obe2P8I Pht790OBLtSGd2Dli3a93IJvvUBfv3BPy4y4d8ED8uCwIkCQ6o+lYxsm6/1WEsNwS99M P+3w== X-Gm-Message-State: AG10YOT1k9J27t88CPzlkwWEqc7eoxQjcEATT3TLMkRIURICT1RlQHriQdbaubAqhzR5Mf2e X-Received: by 10.66.220.7 with SMTP id ps7mr11855906pac.58.1455816598588; Thu, 18 Feb 2016 09:29:58 -0800 (PST) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id fn3sm11657621pab.20.2016.02.18.09.29.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 18 Feb 2016 09:29:57 -0800 (PST) From: Lina Iyer To: ulf.hansson@linaro.org, khilman@kernel.org, rjw@rjwysocki.net, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Cc: geert@linux-m68k.org, k.kozlowski@samsung.com, msivasub@codeaurora.org, agross@codeaurora.org, sboyd@codeaurora.org, linux-arm-msm@vger.kernel.org, lorenzo.pieralisi@arm.com, ahaslam@baylibre.com, mtitinger@baylibre.com, Lina Iyer Subject: [BUG FIX] PM / cpu_domains: Check for NULL callbacks Date: Thu, 18 Feb 2016 10:29:33 -0700 Message-Id: <1455816573-43849-1-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1455310238-8963-4-git-send-email-lina.iyer@linaro.org> References: <1455310238-8963-4-git-send-email-lina.iyer@linaro.org> Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Check for NULL platform callback before calling. Signed-off-by: Lina Iyer --- drivers/base/power/cpu_domains.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) -- 2.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/drivers/base/power/cpu_domains.c b/drivers/base/power/cpu_domains.c index 7069411..bcaa474 100644 --- a/drivers/base/power/cpu_domains.c +++ b/drivers/base/power/cpu_domains.c @@ -157,16 +157,22 @@ static int cpu_pd_power_on(struct generic_pm_domain *genpd) { struct cpu_pm_domain *pd = to_cpu_pd(genpd); - return pd->ops.power_on(); + if (pd->ops.power_on) + return pd->ops.power_on(); + + return 0; } static int cpu_pd_power_off(struct generic_pm_domain *genpd) { struct cpu_pm_domain *pd = to_cpu_pd(genpd); - return pd->ops.power_off(genpd->state_idx, + if (pd->ops.power_off) + return pd->ops.power_off(genpd->state_idx, genpd->states[genpd->state_idx].param, pd->cpus); + + return 0; } /**