From patchwork Tue Mar 1 21:15:19 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 63348 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp2050225lbc; Tue, 1 Mar 2016 13:16:04 -0800 (PST) X-Received: by 10.66.222.199 with SMTP id qo7mr33417757pac.38.1456866963310; Tue, 01 Mar 2016 13:16:03 -0800 (PST) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yv4si14565505pab.119.2016.03.01.13.16.03; Tue, 01 Mar 2016 13:16:03 -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 S1751988AbcCAVQB (ORCPT + 7 others); Tue, 1 Mar 2016 16:16:01 -0500 Received: from mail-pa0-f44.google.com ([209.85.220.44]:36800 "EHLO mail-pa0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752321AbcCAVQA (ORCPT ); Tue, 1 Mar 2016 16:16:00 -0500 Received: by mail-pa0-f44.google.com with SMTP id yy13so118693739pab.3 for ; Tue, 01 Mar 2016 13:16:00 -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=ebMft5hgfQOgSmb32FJOGV3x701RRXcknm4x6ZEbwp2MXd3rCtVuBpsK6gehO2YzHd j6/Y3Ax9uNpLKSDM8UtI2vOXjFJvWISd8k+11q1wUjX59IMQcP+bXzwG+W3oK6QOj3dP 5wWD141JauZXANToEu1+EAcN5Y14NTr0EIGYA= 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=c5DrpZHmFQQlRV2rZTgUyleeuQb6mM3XSVMhNvo6au63ZSi81Hi6L/jpWmV0m/R5KS tO0MtcHhjifg0gQTgQCCuEfCi8Y+EJnQn138rkbX35/eQduq9zRC7AAhNeIpMoqHiZcf pSun757//bkXoQcnsV3LarcaqqE/Z3W5IQYHzUyV1vQGHvT53WUiPkoIlDmjuWb8Q390 A6bfGwULtrkBOwGr5Ahj8iE381ClE2jMoKXBq79xygipODgIWaa5faRBzk0NgjyFVBkw kLGH9/TYT/0gYSy0IVrZtohWtbamQ8GuUI5TKGVWiFFVPquxW2zLBuQdXZUBCgPdzwAG qBVA== X-Gm-Message-State: AD7BkJK5f4gL9tE62lH3engL97nn9/xKTWDnBsRrS/5TV7Cu14JaEoteMDx7bqjQuQcckKkV X-Received: by 10.66.61.204 with SMTP id s12mr33776300par.108.1456866959958; Tue, 01 Mar 2016 13:15:59 -0800 (PST) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by smtp.gmail.com with ESMTPSA id kw10sm47749328pab.0.2016.03.01.13.15.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 01 Mar 2016 13:15:59 -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: Tue, 1 Mar 2016 14:15:19 -0700 Message-Id: <1456866931-37851-2-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1456866931-37851-1-git-send-email-lina.iyer@linaro.org> References: <1456866931-37851-1-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; } /**