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: 9493591 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 41A2162ABB for ; Mon, 2 Jan 2017 13:33:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3394B2015F for ; Mon, 2 Jan 2017 13:33:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2839E223B2; Mon, 2 Jan 2017 13:33:53 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 987C82679B for ; Mon, 2 Jan 2017 13:33:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933118AbdABNdn (ORCPT ); Mon, 2 Jan 2017 08:33:43 -0500 Received: from mail-pf0-f179.google.com ([209.85.192.179]:36213 "EHLO mail-pf0-f179.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933059AbdABNdk (ORCPT ); Mon, 2 Jan 2017 08:33:40 -0500 Received: by mail-pf0-f179.google.com with SMTP id 189so73235868pfz.3 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=M5uFt4NWXaIOm6gSg9+8MyF1qDoh9DdAw0peDYUtVE8AGLNh4c+uV4K12k28UZIDAg 5kgOMdNk7DWmdDzPKEX0AtNycDpU48hR0oJB/gKElA3T8ZfBr8KOG2RMTX7fhhsQS/fW dPjsWN8UplgAXstuNlo5wIQaBQtJabJ+P6evAfdEjsM8mG54Gmp0FsimDXA5FDH9yLoS u18e3g29DlSsBF1E9fvDWTB+TCF+t1JJYygNGb1Y3Ccxx+boDquFmmd5lCPuJKXnk/ut rwNN0RcLlKZK6JQSaNRMF71WkVPhth7HVbOZVGYf0MY8NCvrT5KiQqIVekHedjwSeqFW av0w== X-Gm-Message-State: AIkVDXIosuzX/LHicFaN9OrM9wd8FKMXso4xhO47dsKgnEfb0BOZ3qX91KpBtyLqzE+gp4FH 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 Cc: linux-acpi@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linuxarm@huawei.com, Thomas Gleixner , Greg KH , Tomasz Nowicki , Ma Jun , Kefeng Wang , Agustin Vega-Frias , Sinan Kaya , charles.garcia-tobin@arm.com, huxinwei@huawei.com, yimin@huawei.com, Jon Masters , Hanjun Guo 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> Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.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; } }