On Tue, 2007-10-16 at 16:39 +0200, Thomas Renninger wrote: > On Mon, 2007-10-15 at 17:48 +0100, Matthew Garrett wrote: > > Why not just call acpi_get_pyhsical_device() on the appropriate handle > > and look at the struct device you get back? > Remember to put_device() it once you're done. First read, then post..., forgot the put_device... This one is better. > Len can you apply this one, pls. Thomas Recent Lenovo ThinkPads define a dummy grahpics device, find it and ignore it Signed-off-by: Thomas Renninger <trenn@xxxxxxx> --- drivers/acpi/video.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) Index: lenb/drivers/acpi/video.c =================================================================== --- lenb.orig/drivers/acpi/video.c +++ lenb/drivers/acpi/video.c @@ -34,6 +34,7 @@ #include <linux/input.h> #include <linux/backlight.h> #include <linux/video_output.h> +#include <linux/acpi.h> #include <asm/uaccess.h> #include <acpi/acpi_bus.h> @@ -1901,11 +1902,25 @@ static int acpi_video_bus_add(struct acp acpi_status status = 0; struct acpi_video_bus *video = NULL; struct input_dev *input; + struct device *dev; if (!device) return -EINVAL; + /* + * Check whether we have really a graphics device physically + * in the slot and registered at the system. + */ + dev = acpi_get_physical_device(device->handle); + if (!dev) { + printk (KERN_DEBUG PREFIX "Video device %s.%s not physically" + " connected, ignoring\n", acpi_device_bid(device), + device->parent ? acpi_device_bid(device->parent) : ""); + return -ENODEV; + } + put_device(dev); + video = kzalloc(sizeof(struct acpi_video_bus), GFP_KERNEL); if (!video) return -ENOMEM; ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/ _______________________________________________ ibm-acpi-devel mailing list ibm-acpi-devel@xxxxxxxxxxxxxxxxxxxxx https://lists.sourceforge.net/lists/listinfo/ibm-acpi-devel