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: 8470251 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F354E9F8A8 for ; Tue, 1 Mar 2016 21:16:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 599AA2034A for ; Tue, 1 Mar 2016 21:16:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 221D32035D for ; Tue, 1 Mar 2016 21:16:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752712AbcCAVQB (ORCPT ); Tue, 1 Mar 2016 16:16:01 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:33858 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751988AbcCAVQA (ORCPT ); Tue, 1 Mar 2016 16:16:00 -0500 Received: by mail-pa0-f42.google.com with SMTP id fy10so118628710pac.1 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=nDupk8LPC2gRfQaRZoAya4ksBg8w4NAL+krVvyegRP229DnQ8p05k47+gvuobZWIws K6xUDKPGSQwd0vD2cX8/pVirfSsKafV+ODAthCmWKKNXTR1kjrqrJ06HrY1+T34a8Q+x IVqw5Sdd4mjAn0oZC7ONHBT2CHtTsAaRVsPm0rfynhcrtd8E636POWFeJ3dqNPBpVTR6 nm6Fg+sm/g4ujlKm46A1ppm0rro8y0u6wxAY8ihZ82nBo3bCb/Axhl6kNaFZIgXfiins roqdfT9E5Jg7Gpz2mRegmPfCQQ2Srb81xElDYMEhpXteVnnc4jKkpkD4SsHTnd5Pw9Nm XWXg== X-Gm-Message-State: AD7BkJIRCHNpTXhTi/6dRNA9z1jle9NbWcV5v7fs8Xuuo9ThGT06suLC6p+59sDZB7hRl5Vh 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-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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; } /**