From patchwork Mon Mar 23 15:46:29 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lina Iyer X-Patchwork-Id: 6074021 Return-Path: X-Original-To: patchwork-linux-arm@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 F26AE9F350 for ; Mon, 23 Mar 2015 15:49:19 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1C89B2026C for ; Mon, 23 Mar 2015 15:49:19 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1F72A20260 for ; Mon, 23 Mar 2015 15:49:18 +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 1Ya4ZY-0002aL-2h; Mon, 23 Mar 2015 15:47:24 +0000 Received: from mail-pd0-f169.google.com ([209.85.192.169]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Ya4ZS-0002Sm-RS for linux-arm-kernel@lists.infradead.org; Mon, 23 Mar 2015 15:47:19 +0000 Received: by pdbcz9 with SMTP id cz9so191121223pdb.3 for ; Mon, 23 Mar 2015 08:46:56 -0700 (PDT) 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=7sGWk4/FyneY1r81vsgV12+tWe3bV7dm2jfcgiOy37w=; b=Ci/FY2LIX8BcmMdR7K3Ftm+sbBiYCVPM00LA/lGbtpuMWmP4obcDSqRCE9/gSG27O7 X1h7GPidvf19Uq+taKGYXKOSDUe3ucUnbVxkopzCvz9z8UkT3kxJAuJDyWNDQh+CH9Du xKQJ1GK+eZlMCUb5uuG+K78pbiJsHneSGLqHm67DWhNexGsihFqCfWpHHW+UT0KwiDQW 6FEMdzUTC5jAJpwpJv8mYZHlJAhbWY1K7AsYM8pOkMUFPp/5VXJyju11JjqqRLBwfUtr l3zJYtNR1oahPEBpdJvkSRvPFFz0VmG4NkNiLkF0l+h098W4xBZ6zQuonkMt/QJS2Py4 wTBg== X-Gm-Message-State: ALoCoQmfRccGHPzAuL/1S63VNoVOeXfvIRUVhWhBC3zxcP9NVuuSZ4c9G1Op7PwOLgrrCwSDZSMb X-Received: by 10.68.226.161 with SMTP id rt1mr21962768pbc.101.1427125616566; Mon, 23 Mar 2015 08:46:56 -0700 (PDT) Received: from ubuntu.localdomain (i-global254.qualcomm.com. [199.106.103.254]) by mx.google.com with ESMTPSA id ob7sm1459267pdb.13.2015.03.23.08.46.53 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 23 Mar 2015 08:46:55 -0700 (PDT) From: Lina Iyer To: daniel.lezcano@linaro.org, khilman@linaro.org, sboyd@codeaurora.org, galak@codeaurora.org, linux-arm-msm@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org Subject: [PATCH v17] Currently SPM driver always initializes before the cpuidle driver Date: Mon, 23 Mar 2015 09:46:29 -0600 Message-Id: <1427125589-63560-1-git-send-email-lina.iyer@linaro.org> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1426882877-33008-2-git-send-email-lina.iyer@linaro.org> References: <1426882877-33008-2-git-send-email-lina.iyer@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150323_084718_938108_05F29191 X-CRM114-Status: GOOD ( 12.73 ) X-Spam-Score: -0.7 (/) Cc: msivasub@codeaurora.org, devicetree@vger.kernel.org, lorenzo.pieralisi@arm.com, Lina Iyer , agross@codeaurora.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , 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.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, 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 Remove unnecessary complexity in supporting initialization of SPM driver after cpuidle driver. The current kernel initializes SPM driver before cpuidle driver. Signed-off-by: Lina Iyer --- drivers/soc/qcom/spm.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) diff --git a/drivers/soc/qcom/spm.c b/drivers/soc/qcom/spm.c index cda321c..84344e7 100644 --- a/drivers/soc/qcom/spm.c +++ b/drivers/soc/qcom/spm.c @@ -266,13 +266,9 @@ static int __init qcom_cpuidle_init(struct device_node *cpu_node, int cpu) per_cpu(qcom_idle_ops, cpu) = fns; /* - * Condition: cpuidle_driver_register() needs to happen before - * cpuidle_register_device(). - * Check if the SPM probe has happened - - * - If SPM probed successfully before arm_idle_init(), then defer - * the registration of cpuidle_device back to arm_idle_init() - * - If the SPM probe happens in the future, then let the SPM probe - * register the cpuidle device, return -ENXIO. + * SPM probe for the cpu should have happened by now, if the + * SPM device does not exist, return -ENXIO to indicate that the + * cpu does not support idle states. */ check_spm: return per_cpu(cpu_spm_drv, cpu) ? 0 : -ENXIO; @@ -332,7 +328,6 @@ static int spm_dev_probe(struct platform_device *pdev) const struct of_device_id *match_id; void __iomem *addr; int cpu; - int ret = 0; drv = spm_get_drv(pdev, &cpu); if (!drv) @@ -373,22 +368,7 @@ static int spm_dev_probe(struct platform_device *pdev) per_cpu(cpu_spm_drv, cpu) = drv; - /* - * If the cpuidle ops have already been registered with cpuidle, - * then we have been waiting on this SPM probe to register the - * cpuidle device. - */ - if (per_cpu(qcom_idle_ops, cpu)) { - struct cpuidle_device *dev; - - dev = devm_kzalloc(&pdev->dev, sizeof(*dev), GFP_KERNEL); - if (!dev) - return -ENOMEM; - dev->cpu = cpu; - ret = cpuidle_register_device(dev); - } - - return ret; + return 0; } static struct platform_driver spm_driver = {