From patchwork Wed Nov 25 09:16:48 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Rui" X-Patchwork-Id: 62732 Received: from vger.kernel.org (vger.kernel.org [209.132.176.167]) by demeter.kernel.org (8.14.2/8.14.2) with ESMTP id nAP9IIeM022945 for ; Wed, 25 Nov 2009 09:18:18 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753519AbZKYJSK (ORCPT ); Wed, 25 Nov 2009 04:18:10 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1754061AbZKYJSK (ORCPT ); Wed, 25 Nov 2009 04:18:10 -0500 Received: from mga09.intel.com ([134.134.136.24]:43732 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753519AbZKYJSJ (ORCPT ); Wed, 25 Nov 2009 04:18:09 -0500 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 25 Nov 2009 01:17:57 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.47,285,1257148800"; d="scan'208";a="572979940" Received: from rzhang1-desktop.sh.intel.com (HELO [10.239.36.59]) ([10.239.36.59]) by orsmga001.jf.intel.com with ESMTP; 25 Nov 2009 01:17:58 -0800 Subject: [PATCH] ACPI video: print out a warning message when duplicate video bus devices under the same VGA controller are detected From: Zhang Rui To: Len Brown Cc: "linux-acpi@vger.kernel.org" , "Zhang, Rui" Date: Wed, 25 Nov 2009 17:16:48 +0800 Message-ID: <1259140608.10510.62.camel@rzhang1-desktop> Mime-Version: 1.0 X-Mailer: Evolution 2.28.1 Sender: linux-acpi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-acpi@vger.kernel.org Index: linux-2.6/drivers/acpi/video.c =================================================================== --- linux-2.6.orig/drivers/acpi/video.c +++ linux-2.6/drivers/acpi/video.c @@ -2233,12 +2233,36 @@ static int acpi_video_resume(struct acpi return AE_OK; } +static acpi_status +acpi_video_bus_match(acpi_handle handle, u32 level, void *context, + void **return_value) +{ + struct acpi_device *device = context; + struct acpi_device *sibling; + int result; + + if (handle == device->handle) + return AE_CTRL_TERMINATE; + + result = acpi_bus_get_device(handle, &sibling); + if (result) + return AE_OK; + + if (!strcmp(acpi_device_name(sibling), ACPI_VIDEO_BUS_NAME)) + printk(KERN_WARNING FW_BUG "Duplicate ACPI video bus " + "devices for the same VGA controller\n"); + return AE_OK; +} + static int acpi_video_bus_add(struct acpi_device *device) { struct acpi_video_bus *video; struct input_dev *input; int error; + acpi_walk_namespace(ACPI_TYPE_DEVICE, device->parent->handle, + 1, acpi_video_bus_match, device, NULL); + video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); if (!video) return -ENOMEM;