From patchwork Mon Jan 2 13:31:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hanjun Guo X-Patchwork-Id: 9493637 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id E707762ABB for ; Mon, 2 Jan 2017 13:35:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D5DCE1FF35 for ; Mon, 2 Jan 2017 13:35:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CA908266F3; Mon, 2 Jan 2017 13:35:51 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 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.wl.linuxfoundation.org (Postfix) with ESMTPS id 5B8E82015F for ; Mon, 2 Jan 2017 13:35:51 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cO2kn-000630-TJ; Mon, 02 Jan 2017 13:34:21 +0000 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cO2kS-0005eH-Vn for linux-arm-kernel@lists.infradead.org; Mon, 02 Jan 2017 13:34:05 +0000 Received: by mail-pf0-x229.google.com with SMTP id i88so72927774pfk.2 for ; Mon, 02 Jan 2017 05:33:40 -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=LvnBvg8Qk9UV5iauDb5QuMvhif4+rsYAarZ3sEiurzY=; b=cOH0zbJv4VqUcHV2iTb3TW9Z8aZkq1CCzSMHT9B/iIjf+P40SoOQ9YIEjraZR2TGQt G5J+TlYqq48rYkkoLTlDrYKQRg4mywp60NE0W7SbyNMU1OZmCCvlMKmtuvrkZynK7T0u dXytvfFWCWgVpkB/S6u2+szFpva/FdIEmDcjc= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=LvnBvg8Qk9UV5iauDb5QuMvhif4+rsYAarZ3sEiurzY=; b=d0CsNlJj6Q2CItVNlZacPCCt6t7WxTvl6rEjj+YSTs1vrN6y7XW6HOlv6MRWyGtJEb PXazfZzJLw4Dp7bk2IJh3nLz87UwB+v+XsaCYQKk7IMnfH5+nynoqx4ZAX/28j9BUthm VYe/dt1XUSBNbt8vbYrFWx5RyU3JMNxj4OTfnqm9GvCRWOxtGNZrv7KHGrFRlRselQaX Bk0mAWuwETD+COaxnY5VRKvcCqceWoVdSUwb+lg3q5uukZbiMO0P1I+WfJxePxNnx71p tfZE/aD9iFwbPB5czRrsvOS7XQI0/P69gNbVi69TxCJtDrxHl0lN8ZT5hul8D1iJMui0 iNrw== X-Gm-Message-State: AIkVDXIhIMPT6SXPytKeGKZ+hYXOdG53LYCbkCF7QwL97Fnblf+sQLgP4luAdcudE2mgOBhZ X-Received: by 10.99.129.67 with SMTP id t64mr105872788pgd.4.1483364019809; Mon, 02 Jan 2017 05:33:39 -0800 (PST) Received: from localhost ([104.237.91.251]) by smtp.googlemail.com with ESMTPSA id w24sm132606069pfa.9.2017.01.02.05.33.38 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Mon, 02 Jan 2017 05:33:39 -0800 (PST) From: Hanjun Guo To: Marc Zyngier , "Rafael J. Wysocki" , Lorenzo Pieralisi Subject: [PATCH v6 08/14] ACPI: ARM64: IORT: rework iort_node_get_id() Date: Mon, 2 Jan 2017 21:31:39 +0800 Message-Id: <1483363905-2806-9-git-send-email-hanjun.guo@linaro.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1483363905-2806-1-git-send-email-hanjun.guo@linaro.org> References: <1483363905-2806-1-git-send-email-hanjun.guo@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170102_053401_423470_D0863B89 X-CRM114-Status: GOOD ( 11.97 ) 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: huxinwei@huawei.com, Kefeng Wang , charles.garcia-tobin@arm.com, Jon Masters , yimin@huawei.com, Greg KH , linux-kernel@vger.kernel.org, linuxarm@huawei.com, Sinan Kaya , linux-acpi@vger.kernel.org, Hanjun Guo , Tomasz Nowicki , Thomas Gleixner , Agustin Vega-Frias , linux-arm-kernel@lists.infradead.org, Ma Jun MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP iort_node_get_id() has two output, one is the mapped ids, the other is the referenced parent node which is returned from the function. For now we need a API just return its parent node for single mapping, so just update this function slightly then reuse it later. Signed-off-by: Hanjun Guo Tested-by: Majun Tested-by: Xinwei Kong Cc: Lorenzo Pieralisi Cc: Marc Zyngier --- drivers/acpi/arm64/iort.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/arm64/iort.c b/drivers/acpi/arm64/iort.c index ab7bae7..bc68d93 100644 --- a/drivers/acpi/arm64/iort.c +++ b/drivers/acpi/arm64/iort.c @@ -347,7 +347,8 @@ struct acpi_iort_node *iort_node_get_id(struct acpi_iort_node *node, if (map[index].flags & ACPI_IORT_ID_SINGLE_MAPPING) { if (node->type == ACPI_IORT_NODE_NAMED_COMPONENT || node->type == ACPI_IORT_NODE_PCI_ROOT_COMPLEX) { - *id_out = map[index].output_base; + if (id_out) + *id_out = map[index].output_base; return parent; } }