From patchwork Wed Aug 10 00:42:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bjorn Andersson X-Patchwork-Id: 73596 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp149928qga; Tue, 9 Aug 2016 17:42:59 -0700 (PDT) X-Received: by 10.98.33.72 with SMTP id h69mr2147330pfh.28.1470789779828; Tue, 09 Aug 2016 17:42:59 -0700 (PDT) Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id y80si45276076pfi.205.2016.08.09.17.42.59; Tue, 09 Aug 2016 17:42:59 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org; 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; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932452AbcHJAm6 (ORCPT + 8 others); Tue, 9 Aug 2016 20:42:58 -0400 Received: from mail-pa0-f50.google.com ([209.85.220.50]:34415 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752499AbcHJAm5 (ORCPT ); Tue, 9 Aug 2016 20:42:57 -0400 Received: by mail-pa0-f50.google.com with SMTP id fi15so10014850pac.1 for ; Tue, 09 Aug 2016 17:42:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=4gMP/ABRhuQIHzuUFsMCXwNEELRWXea+3sNqCC8/kLM=; b=ECJ547R/9FarXgJSxuz3TKTFXv77AXzpdydy2wLTQR0ssP0WJ5KgabQr138YJdUmGz A1tQhrmLIv+eou+h41Jc1Y49FmCKJJbCaAGKWhOhEBYZ20un6X7thWaos9qXZcYt+OeJ YXGsoP/nImMTay5TndX/uY7cPN8hQroHpkJKs= 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; bh=4gMP/ABRhuQIHzuUFsMCXwNEELRWXea+3sNqCC8/kLM=; b=QDZDF70WO3GyJ1B2z7MfZsfS5MSG5nzcm47BxsyQ3XAuKZ9nBCZBKTufETI7nTaq4d 24l2iXr37sNYecxuJX8GkdPNJI3kzc3XPfkQQouIdUYEvbxKcN5GhoLPyFvMb+rfg6KL 6UaYbvhJ2m7/8sSaa0P7VOBhSYMW/L0GR9qh2c90voHa62v/Mb9UQQRxiT9y9ypJYXia nblo8czekI3N0sczcQfntlWbB3fkm791SEUEZjlmjTGEKiq+Rmo62gFo9kLzxKLe7GTE foH7sQ6uieTAwKIbU2xoBYrHXbqq1ii9A3tz6uIWVu2CX0EnIy+t8z0a4bA8EvgDGi3C vmNw== X-Gm-Message-State: AEkoouu+DiVB2U6djLnsj83slQo8GrVy5x6kbjV+ATDZqBDtmS6XZfPqH4Z18WqNiSSGqElz X-Received: by 10.66.182.232 with SMTP id eh8mr2102313pac.146.1470789777016; Tue, 09 Aug 2016 17:42:57 -0700 (PDT) Received: from localhost.localdomain (ip68-111-223-48.sd.sd.cox.net. [68.111.223.48]) by smtp.gmail.com with ESMTPSA id c8sm58707238pfe.39.2016.08.09.17.42.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 09 Aug 2016 17:42:56 -0700 (PDT) From: Bjorn Andersson To: Andy Gross Cc: linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] soc: qcom: smd: Request irqs after parsing properties Date: Tue, 9 Aug 2016 17:42:55 -0700 Message-Id: <1470789775-5517-1-git-send-email-bjorn.andersson@linaro.org> X-Mailer: git-send-email 2.5.0 Sender: linux-arm-msm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org The code exectued by the interrupt handler depends on the values parsed after requesting the irq, just to be save we should therefor move the request_irq() call to be done after parsing the properties. Signed-off-by: Bjorn Andersson --- drivers/soc/qcom/smd.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) -- 2.5.0 -- 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/soc/qcom/smd.c b/drivers/soc/qcom/smd.c index 63e72eb9baa7..679f7778a4e3 100644 --- a/drivers/soc/qcom/smd.c +++ b/drivers/soc/qcom/smd.c @@ -1348,22 +1348,6 @@ static int qcom_smd_parse_edge(struct device *dev, edge->of_node = of_node_get(node); - irq = irq_of_parse_and_map(node, 0); - if (irq < 0) { - dev_err(dev, "required smd interrupt missing\n"); - return -EINVAL; - } - - ret = devm_request_irq(dev, irq, - qcom_smd_edge_intr, IRQF_TRIGGER_RISING, - node->name, edge); - if (ret) { - dev_err(dev, "failed to request smd irq\n"); - return ret; - } - - edge->irq = irq; - key = "qcom,smd-edge"; ret = of_property_read_u32(node, key, &edge->edge_id); if (ret) { @@ -1398,6 +1382,22 @@ static int qcom_smd_parse_edge(struct device *dev, return -EINVAL; } + irq = irq_of_parse_and_map(node, 0); + if (irq < 0) { + dev_err(dev, "required smd interrupt missing\n"); + return -EINVAL; + } + + ret = devm_request_irq(dev, irq, + qcom_smd_edge_intr, IRQF_TRIGGER_RISING, + node->name, edge); + if (ret) { + dev_err(dev, "failed to request smd irq\n"); + return ret; + } + + edge->irq = irq; + return 0; }