From patchwork Wed Mar 14 18:15:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 131706 Delivered-To: patch@linaro.org Received: by 10.46.84.17 with SMTP id i17csp154754ljb; Wed, 14 Mar 2018 11:20:14 -0700 (PDT) X-Google-Smtp-Source: AG47ELvB6b0vU7LjN2/AbyF7HhnxZa+1gaoxfJX5crzrcxWar2PraXTI82YfoGaQ2fe9fO+e3zp+ X-Received: by 10.99.101.198 with SMTP id z189mr4466679pgb.97.1521051614513; Wed, 14 Mar 2018 11:20:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521051614; cv=none; d=google.com; s=arc-20160816; b=XWBWFWMGjXT0U12k2fGVoaT/TCF/x6cFfLLzi5kHXJYSHei3RAHnctnujmBLJhe1fL jlRofXLTjTBwc9sPQy/W42URJXpy+fvkxRnACNihu1d9A3Gp3V7vwZd0VMBtfzUqw4ZG tSMRUA0fgBlwuoaF/UWxxlbSE/r9rKWopQWV5/fGVLLSAOusl+UbGqSxnaHmkgAw2qDf WVebhehuQsetJ9JWEW95ApC2etECUdhxJiJIXHFQuygSwqHskXJFp6GAhjWak3nxPE1o BJXEib45Q1C36hKArTlEoSMGbr2T66q5D+Mqu+2ghhV7brxGtwjPBo0PId5mLq7MLSh3 KqrQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:arc-authentication-results; bh=B+pCoh0sl6Bwdm4gJuX082CPeVJBaeHzPTGr0X1haVs=; b=e04R0kS8lwbxuBiTmAsJbC5KbUXEXOwWVCvyZw/MbOuwiDSP00pjsBc2exakpHmlLN OrMar4f4xW/OwXqbaW//qDV846qgmZSBkDAMBKa29mzuG654HsatSZkcK1bSdMzPG5tG VVsS9f1jF7FOGW9B2FzQQ9miK3mAMOLNvU/Vge1bX+oa9waXY+jrfjZu6l/auRA5A8ff sLUUE2kesWlhpy8aeYHJLJ5ZtvNCeTtQKh2jI7Qx5ZJz7r8jWCNhdAhaPjfciL7vEBRA iT5WrQS/n80e1BTPEMMAsyVZEEd273HNx2lecCNK8CEZmoDRb6a2ayWpO5TclImRwbX6 /n8g== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j17si2165851pga.495.2018.03.14.11.20.14; Wed, 14 Mar 2018 11:20:14 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752635AbeCNSUH (ORCPT + 28 others); Wed, 14 Mar 2018 14:20:07 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:6637 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751357AbeCNSRG (ORCPT ); Wed, 14 Mar 2018 14:17:06 -0400 Received: from DGGEMS408-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 411A2ECDE6271; Thu, 15 Mar 2018 02:16:51 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS408-HUB.china.huawei.com (10.3.19.208) with Microsoft SMTP Server id 14.3.361.1; Thu, 15 Mar 2018 02:16:46 +0800 From: John Garry To: , , , , , , , , , , , , , CC: , , , , , , , , , , , , , Subject: [PATCH v17 07/10] ACPI / scan: rename acpi_is_serial_bus_slave() to widen use Date: Thu, 15 Mar 2018 02:15:56 +0800 Message-ID: <1521051359-34473-8-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1521051359-34473-1-git-send-email-john.garry@huawei.com> References: <1521051359-34473-1-git-send-email-john.garry@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Currently the ACPI scan has special handling for serial bus slaves, in that it makes it the responsibility of the the slave device's parent to enumerate the device. To support in future other types of slave devices which require the same special handling, but where the bus is not strictly a serial bus - such as devices on the HiSilicon LPC controller bus - rename acpi_is_serial_bus_slave() to acpi_device_enumeration_by_parent(), so that the name can fit the wider purpose. Associated device flag acpi_device_flags.serial_bus_slave is also renamed to .enumeration_by_parent. Signed-off-by: John Garry --- drivers/acpi/scan.c | 19 ++++++++++--------- include/acpi/acpi_bus.h | 2 +- 2 files changed, 11 insertions(+), 10 deletions(-) -- 1.9.1 diff --git a/drivers/acpi/scan.c b/drivers/acpi/scan.c index 8e63d93..f9e7904 100644 --- a/drivers/acpi/scan.c +++ b/drivers/acpi/scan.c @@ -1524,7 +1524,7 @@ static int acpi_check_serial_bus_slave(struct acpi_resource *ares, void *data) return -1; } -static bool acpi_is_serial_bus_slave(struct acpi_device *device) +static bool acpi_device_enumeration_by_parent(struct acpi_device *device) { struct list_head resource_list; bool is_serial_bus_slave = false; @@ -1560,7 +1560,8 @@ void acpi_init_device_object(struct acpi_device *device, acpi_handle handle, acpi_bus_get_flags(device); device->flags.match_driver = false; device->flags.initialized = true; - device->flags.serial_bus_slave = acpi_is_serial_bus_slave(device); + device->flags.enumeration_by_parent = + acpi_device_enumeration_by_parent(device); acpi_device_clear_enumerated(device); device_initialize(&device->dev); dev_set_uevent_suppress(&device->dev, true); @@ -1858,10 +1859,10 @@ static acpi_status acpi_bus_check_add(acpi_handle handle, u32 lvl_not_used, static void acpi_default_enumeration(struct acpi_device *device) { /* - * Do not enumerate SPI/I2C/UART slaves as they will be enumerated by - * their respective parents. + * Do not enumerate devices with enumeration_by_parent flag set as + * they will be enumerated by their respective parents. */ - if (!device->flags.serial_bus_slave) { + if (!device->flags.enumeration_by_parent) { acpi_create_platform_device(device, NULL); acpi_device_set_enumerated(device); } else { @@ -1958,7 +1959,7 @@ static void acpi_bus_attach(struct acpi_device *device) return; device->flags.match_driver = true; - if (ret > 0 && !device->flags.serial_bus_slave) { + if (ret > 0 && !device->flags.enumeration_by_parent) { acpi_device_set_enumerated(device); goto ok; } @@ -1967,10 +1968,10 @@ static void acpi_bus_attach(struct acpi_device *device) if (ret < 0) return; - if (!device->pnp.type.platform_id && !device->flags.serial_bus_slave) - acpi_device_set_enumerated(device); - else + if (device->pnp.type.platform_id || device->flags.enumeration_by_parent) acpi_default_enumeration(device); + else + acpi_device_set_enumerated(device); ok: list_for_each_entry(child, &device->children, node) diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h index c9608b0..ba4dd54 100644 --- a/include/acpi/acpi_bus.h +++ b/include/acpi/acpi_bus.h @@ -215,7 +215,7 @@ struct acpi_device_flags { u32 of_compatible_ok:1; u32 coherent_dma:1; u32 cca_seen:1; - u32 serial_bus_slave:1; + u32 enumeration_by_parent:1; u32 reserved:19; };