From patchwork Sat Oct 6 15:27:27 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jiang Liu X-Patchwork-Id: 1558311 X-Patchwork-Delegate: bhelgaas@google.com Return-Path: X-Original-To: patchwork-linux-pci@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by patchwork1.kernel.org (Postfix) with ESMTP id 3E4D93FCFC for ; Sat, 6 Oct 2012 15:35:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754545Ab2JFPec (ORCPT ); Sat, 6 Oct 2012 11:34:32 -0400 Received: from mail-pb0-f46.google.com ([209.85.160.46]:55127 "EHLO mail-pb0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754316Ab2JFPe3 (ORCPT ); Sat, 6 Oct 2012 11:34:29 -0400 Received: by mail-pb0-f46.google.com with SMTP id rr4so2817005pbb.19 for ; Sat, 06 Oct 2012 08:34:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=kKkXCMJkOZVKi51woVoEbnRBQLMuPSe6X8MhD7moXpc=; b=IG8cPPWo//Z7sDLFbH4tKG0kOPKzIUIf1hx9CUuBHDmOpgFqen8oQmtwCT9tHhYHBW qzTi9kKvG25rzROzrbd11yxc4qIwAzbqhihOwB4QQd7b8RGKm8q45oyrV2SNvtDWjkv4 vPW2DNdFPEr214GpuK+B+szTUTs93JNIN4ClQ03kbNkKTz5qHJlnl6m8ME0Q9DSLZbl6 KWimMLcJaVcSn6cD2i4vlvUsHZj3qHq6707ZY6LgV9+8hkCJTIzHcWBciFD5EUkb455u W/oEdwfJ4W29wtGOMBT5V6DiZ4zbR/K8r2i75iTPkPctScp5y534FnY02mRM+uTFceaB KUKA== Received: by 10.68.116.228 with SMTP id jz4mr39011905pbb.166.1349537668449; Sat, 06 Oct 2012 08:34:28 -0700 (PDT) Received: from localhost.localdomain ([221.221.24.247]) by mx.google.com with ESMTPS id vz8sm7785292pbc.63.2012.10.06.08.34.11 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 06 Oct 2012 08:34:28 -0700 (PDT) From: Jiang Liu To: Yinghai Lu , Yasuaki Ishimatsu , Kenji Kaneshige , Wen Congyang , Tang Chen , Taku Izumi Cc: Hanjun Guo , Yijing Wang , Gong Chen , Jiang Liu , Tony Luck , Huang Ying , Bob Moore , Len Brown , "Srivatsa S . Bhat" , Bjorn Helgaas , linux-kernel@vger.kernel.org, linux-acpi@vger.kernel.org, linux-pci@vger.kernel.org Subject: [RFC PATCH v3 19/28] ACPIHP/container: move container.c into drivers/acpi/hotplug Date: Sat, 6 Oct 2012 23:27:27 +0800 Message-Id: <1349537256-21670-20-git-send-email-jiang.liu@huawei.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1349537256-21670-1-git-send-email-jiang.liu@huawei.com> References: <1349537256-21670-1-git-send-email-jiang.liu@huawei.com> Sender: linux-pci-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pci@vger.kernel.org Now the ACPI container driver is only used to support the ACPI system device hotplug framework, so move it into drivers/acpi/hotplug. Signed-off-by: Jiang Liu --- drivers/acpi/Makefile | 1 - drivers/acpi/container.c | 134 ------------------------------------- drivers/acpi/hotplug/Makefile | 2 + drivers/acpi/hotplug/container.c | 135 ++++++++++++++++++++++++++++++++++++++ 4 files changed, 137 insertions(+), 135 deletions(-) delete mode 100644 drivers/acpi/container.c create mode 100644 drivers/acpi/hotplug/container.c diff --git a/drivers/acpi/Makefile b/drivers/acpi/Makefile index 17bea6c..fa5b6d3 100644 --- a/drivers/acpi/Makefile +++ b/drivers/acpi/Makefile @@ -53,7 +53,6 @@ obj-$(CONFIG_ACPI_FAN) += fan.o obj-$(CONFIG_ACPI_VIDEO) += video.o obj-$(CONFIG_ACPI_PCI_SLOT) += pci_slot.o obj-$(CONFIG_ACPI_PROCESSOR) += processor.o -obj-$(CONFIG_ACPI_CONTAINER) += container.o obj-$(CONFIG_ACPI_THERMAL) += thermal.o obj-$(CONFIG_ACPI_HOTPLUG_MEMORY) += acpi_memhotplug.o obj-$(CONFIG_ACPI_BATTERY) += battery.o diff --git a/drivers/acpi/container.c b/drivers/acpi/container.c deleted file mode 100644 index fbc4a20..0000000 --- a/drivers/acpi/container.c +++ /dev/null @@ -1,134 +0,0 @@ -/* - * acpi_container.c - ACPI Generic Container Driver - * ($Revision: ) - * - * Copyright (C) 2004 Anil S Keshavamurthy (anil.s.keshavamurthy@intel.com) - * Copyright (C) 2004 Keiichiro Tokunaga (tokunaga.keiich@jp.fujitsu.com) - * Copyright (C) 2004 Motoyuki Ito (motoyuki@soft.fujitsu.com) - * Copyright (C) 2004 Intel Corp. - * Copyright (C) 2004 FUJITSU LIMITED - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or (at - * your option) any later version. - * - * This program is distributed in the hope that it will be useful, but - * WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * General Public License for more details. - * - * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. - * - * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - */ -#include -#include -#include -#include -#include -#include -#include -#include -#include - -#define PREFIX "ACPI: " - -#define ACPI_CONTAINER_DEVICE_NAME "ACPI container device" -#define ACPI_CONTAINER_CLASS "container" - -#define _COMPONENT ACPI_CONTAINER_COMPONENT -ACPI_MODULE_NAME("container"); - -MODULE_AUTHOR("Anil S Keshavamurthy"); -MODULE_DESCRIPTION("ACPI container driver"); -MODULE_LICENSE("GPL"); - -static int acpi_container_add(struct acpi_device *device); -static int acpi_container_remove(struct acpi_device *device, int type); - -static int acpihp_container_get_devinfo(struct acpi_device *device, - struct acpihp_dev_info *info); -static int acpihp_container_configure(struct acpi_device *device, - struct acpihp_cancel_context *argp); -static void acpihp_container_unconfigure(struct acpi_device *device); - -struct acpihp_dev_ops acpihp_container_ops = { - .get_info = acpihp_container_get_devinfo, - .configure = acpihp_container_configure, - .unconfigure = acpihp_container_unconfigure, -}; - -static const struct acpi_device_id container_device_ids[] = { - {"ACPI0004", 0}, - {"PNP0A05", 0}, - {"PNP0A06", 0}, - {"", 0}, -}; -MODULE_DEVICE_TABLE(acpi, container_device_ids); - -static struct acpi_driver acpi_container_driver = { - .name = "container", - .class = ACPI_CONTAINER_CLASS, - .ids = container_device_ids, - .ops = { - .add = acpi_container_add, - .remove = acpi_container_remove, - .hp_ops = &acpihp_container_ops, - }, -}; - -static int acpi_container_add(struct acpi_device *device) -{ - if (!device) { - printk(KERN_ERR PREFIX "device is NULL\n"); - return -EINVAL; - } - - strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME); - strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS); - ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", - acpi_device_name(device), acpi_device_bid(device))); - - return 0; -} - -static int acpi_container_remove(struct acpi_device *device, int type) -{ - return AE_OK; -} - -static int acpihp_container_get_devinfo(struct acpi_device *device, - struct acpihp_dev_info *info) -{ - info->type = ACPIHP_DEV_TYPE_CONTAINER; - - return 0; -} - -static int acpihp_container_configure(struct acpi_device *device, - struct acpihp_cancel_context *argp) -{ - return 0; -} - -static void acpihp_container_unconfigure(struct acpi_device *device) -{ -} - -static int __init acpi_container_init(void) -{ - return acpi_bus_register_driver(&acpi_container_driver); -} - -static void __exit acpi_container_exit(void) -{ - acpi_bus_unregister_driver(&acpi_container_driver); -} - -module_init(acpi_container_init); -module_exit(acpi_container_exit); diff --git a/drivers/acpi/hotplug/Makefile b/drivers/acpi/hotplug/Makefile index 57e348a..4b62f7e 100644 --- a/drivers/acpi/hotplug/Makefile +++ b/drivers/acpi/hotplug/Makefile @@ -17,3 +17,5 @@ acpihp_drv-y += cancel.o acpihp_drv-y += configure.o acpihp_drv-y += state_machine.o acpihp_drv-y += sysfs.o + +obj-$(CONFIG_ACPI_CONTAINER) += container.o diff --git a/drivers/acpi/hotplug/container.c b/drivers/acpi/hotplug/container.c new file mode 100644 index 0000000..31dc9f8 --- /dev/null +++ b/drivers/acpi/hotplug/container.c @@ -0,0 +1,135 @@ +/* + * acpi_container.c - ACPI Generic Container Driver + * ($Revision: ) + * + * Copyright (C) 2004 Anil S Keshavamurthy (anil.s.keshavamurthy@intel.com) + * Copyright (C) 2004 Keiichiro Tokunaga (tokunaga.keiich@jp.fujitsu.com) + * Copyright (C) 2004 Motoyuki Ito (motoyuki@soft.fujitsu.com) + * Copyright (C) 2004 Intel Corp. + * Copyright (C) 2004 FUJITSU LIMITED + * Copyright (C) 2004 Jiang Liu (jiang.liu@huawei.com) + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or (at + * your option) any later version. + * + * This program is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. + * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define PREFIX "ACPI: " + +#define ACPI_CONTAINER_DEVICE_NAME "ACPI container device" +#define ACPI_CONTAINER_CLASS "container" + +#define _COMPONENT ACPI_CONTAINER_COMPONENT +ACPI_MODULE_NAME("container"); + +MODULE_AUTHOR("Anil S Keshavamurthy"); +MODULE_DESCRIPTION("ACPI container driver"); +MODULE_LICENSE("GPL"); + +static int acpi_container_add(struct acpi_device *device); +static int acpi_container_remove(struct acpi_device *device, int type); + +static int acpihp_container_get_devinfo(struct acpi_device *device, + struct acpihp_dev_info *info); +static int acpihp_container_configure(struct acpi_device *device, + struct acpihp_cancel_context *argp); +static void acpihp_container_unconfigure(struct acpi_device *device); + +struct acpihp_dev_ops acpihp_container_ops = { + .get_info = acpihp_container_get_devinfo, + .configure = acpihp_container_configure, + .unconfigure = acpihp_container_unconfigure, +}; + +static const struct acpi_device_id container_device_ids[] = { + {"ACPI0004", 0}, + {"PNP0A05", 0}, + {"PNP0A06", 0}, + {"", 0}, +}; +MODULE_DEVICE_TABLE(acpi, container_device_ids); + +static struct acpi_driver acpi_container_driver = { + .name = "container", + .class = ACPI_CONTAINER_CLASS, + .ids = container_device_ids, + .ops = { + .add = acpi_container_add, + .remove = acpi_container_remove, + .hp_ops = &acpihp_container_ops, + }, +}; + +static int acpi_container_add(struct acpi_device *device) +{ + if (!device) { + printk(KERN_ERR PREFIX "device is NULL\n"); + return -EINVAL; + } + + strcpy(acpi_device_name(device), ACPI_CONTAINER_DEVICE_NAME); + strcpy(acpi_device_class(device), ACPI_CONTAINER_CLASS); + ACPI_DEBUG_PRINT((ACPI_DB_INFO, "Device <%s> bid <%s>\n", + acpi_device_name(device), acpi_device_bid(device))); + + return 0; +} + +static int acpi_container_remove(struct acpi_device *device, int type) +{ + return AE_OK; +} + +static int acpihp_container_get_devinfo(struct acpi_device *device, + struct acpihp_dev_info *info) +{ + info->type = ACPIHP_DEV_TYPE_CONTAINER; + + return 0; +} + +static int acpihp_container_configure(struct acpi_device *device, + struct acpihp_cancel_context *argp) +{ + return 0; +} + +static void acpihp_container_unconfigure(struct acpi_device *device) +{ +} + +static int __init acpi_container_init(void) +{ + return acpi_bus_register_driver(&acpi_container_driver); +} + +static void __exit acpi_container_exit(void) +{ + acpi_bus_unregister_driver(&acpi_container_driver); +} + +module_init(acpi_container_init); +module_exit(acpi_container_exit);