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: 8470481 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0CCEEC0553 for ; Tue, 1 Mar 2016 21:18:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2BF792034A for ; Tue, 1 Mar 2016 21:18:15 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 502AA2010E for ; Tue, 1 Mar 2016 21:18:14 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1aarel-00012L-DY; Tue, 01 Mar 2016 21:16:35 +0000 Received: from mail-pa0-x22b.google.com ([2607:f8b0:400e:c03::22b]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aareX-0000ii-5t for linux-arm-kernel@lists.infradead.org; Tue, 01 Mar 2016 21:16:21 +0000 Received: by mail-pa0-x22b.google.com with SMTP id yy13so118693736pab.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=A2fu95a41cqkeTWDCwvmn/IiEVcFVqie0SlY/T9o3bcm1MgJibTo26k8ONZ1hDg9Bv 65Mm2VsMkjQ0qDv4sn87JVtDKQ16aCaMgV8vUPaf+Hh9U9RaVuWjY+uLCaoKELaqXc4j +Z2iaoQ83as2CU+v7i67EXcinljAt1QHPL0H7WZ6rtsMGT0Fj5wryevtCZTjrrbPA4Ed Bp3na1WHzPSpXanpFpHCJ2AYUZvzDmg16S6pIUBsOFXU0mKFt11eoh3E7be2rDi89BVy XwMY+iDHQrkmPFF9SZtP0mZODmw4XyMuCd3AjcpSx5yspm9/DYBs2n6YRf9G5iw5diaB 3wMw== X-Gm-Message-State: AD7BkJJw28ESHY/S9vVcYEr/VkPpzDTSQ5gKGbraWVZJSP0ri7izoP9hJrUgDuW2WiHb6HWy 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160301_131621_360048_741346E0 X-CRM114-Status: GOOD ( 11.47 ) X-Spam-Score: -2.7 (--) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: k.kozlowski@samsung.com, lorenzo.pieralisi@arm.com, ahaslam@baylibre.com, linux-arm-msm@vger.kernel.org, sboyd@codeaurora.org, msivasub@codeaurora.org, geert@linux-m68k.org, Lina Iyer , agross@codeaurora.org, mtitinger@baylibre.com MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,RP_MATCHES_RCVD,T_DKIM_INVALID,UNPARSEABLE_RELAY autolearn=ham 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; } /**