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: 8352751 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 95C2AC0553 for ; Thu, 18 Feb 2016 17:32:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D2C2B20357 for ; Thu, 18 Feb 2016 17:32:06 +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 0D4AD201F2 for ; Thu, 18 Feb 2016 17:32:06 +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 1aWSPG-0000ME-UT; Thu, 18 Feb 2016 17:30:22 +0000 Received: from mail-pa0-x230.google.com ([2607:f8b0:400e:c03::230]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1aWSPD-0007TY-AC for linux-arm-kernel@lists.infradead.org; Thu, 18 Feb 2016 17:30:20 +0000 Received: by mail-pa0-x230.google.com with SMTP id fy10so34268576pac.1 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=lI2+UD+5+d+SQHI5a0GHToPVOqB2JhGBwxdMR3m8BTvWC3zkaVfjsy/6Lhlh3tJWcS JM8Td35wsmZ1pzKs4CSNbRCXnbADZ4jGZ3xN+GUyTGVJ3hs7UrPrygJIOzleEo7yzP98 VS+XFsVf+DYHyFvIIPqFcwfbkiVAK9er4/veEP7K4pSRsNQLcxfAHdLf7TOB2fZpO2hL v3UfgGri4WJa3zJyzHAchbOE5+x8miDrmSmmwUwrlIKqcvtgZYdH8wRxF95uGCPb4gX5 1F0eHCeoHArvBCH6H18DXqf2uO3P6KwBdqM64yA4Tf6WELvqmXtjduqZx83z7+Z+3fLB gbtw== X-Gm-Message-State: AG10YOQ4O0ukmQrHD/Wj+CPBlk0Ihds0k6cgqqg+3WlVJVNyyEagsBLEXWVH8p+u0TFL9uLr 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160218_093019_600076_32AA0DB9 X-CRM114-Status: GOOD ( 12.27 ) 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; } /**