]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/acpi/dock.c
[XFS] fix compilation without CONFIG_PROC_FS
[linux-2.6-omap-h63xx.git] / drivers / acpi / dock.c
index 6192c8be66df62587e0ee49e3af2a31b145b38bc..bb7c51f712bd6cde630e4e8e5a771ca9d9e5fc55 100644 (file)
@@ -51,6 +51,12 @@ static struct atomic_notifier_head dock_notifier_list;
 static struct platform_device *dock_device;
 static char dock_device_name[] = "dock";
 
+static const struct acpi_device_id dock_device_ids[] = {
+       {"LNXDOCK", 0},
+       {"", 0},
+};
+MODULE_DEVICE_TABLE(acpi, dock_device_ids);
+
 struct dock_station {
        acpi_handle handle;
        unsigned long last_dock_time;
@@ -336,13 +342,13 @@ static void hotplug_dock_devices(struct dock_station *ds, u32 event)
 static void dock_event(struct dock_station *ds, u32 event, int num)
 {
        struct device *dev = &dock_device->dev;
-       char event_string[7];
+       char event_string[13];
        char *envp[] = { event_string, NULL };
 
        if (num == UNDOCK_EVENT)
-               sprintf(event_string, "UNDOCK");
+               sprintf(event_string, "EVENT=undock");
        else
-               sprintf(event_string, "DOCK");
+               sprintf(event_string, "EVENT=dock");
 
        /*
         * Indicate that the status of the dock station has
@@ -680,7 +686,7 @@ static ssize_t show_docked(struct device *dev,
        return snprintf(buf, PAGE_SIZE, "%d\n", dock_present(dock_station));
 
 }
-DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
+static DEVICE_ATTR(docked, S_IRUGO, show_docked, NULL);
 
 /*
  * show_flags - read method for flags file in sysfs
@@ -691,7 +697,7 @@ static ssize_t show_flags(struct device *dev,
        return snprintf(buf, PAGE_SIZE, "%d\n", dock_station->flags);
 
 }
-DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
+static DEVICE_ATTR(flags, S_IRUGO, show_flags, NULL);
 
 /*
  * write_undock - write method for "undock" file in sysfs
@@ -704,10 +710,11 @@ static ssize_t write_undock(struct device *dev, struct device_attribute *attr,
        if (!count)
                return -EINVAL;
 
+       begin_undock(dock_station);
        ret = handle_eject_request(dock_station, ACPI_NOTIFY_EJECT_REQUEST);
        return ret ? ret: count;
 }
-DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock);
+static DEVICE_ATTR(undock, S_IWUSR, NULL, write_undock);
 
 /*
  * show_dock_uid - read method for "uid" file in sysfs
@@ -723,7 +730,7 @@ static ssize_t show_dock_uid(struct device *dev,
 
        return snprintf(buf, PAGE_SIZE, "%lx\n", lbuf);
 }
-DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
+static DEVICE_ATTR(uid, S_IRUGO, show_dock_uid, NULL);
 
 /**
  * dock_add - add a new dock station
@@ -827,7 +834,7 @@ static int dock_add(acpi_handle handle)
                goto dock_add_err;
        }
 
-       printk(KERN_INFO PREFIX "%s \n", ACPI_DOCK_DRIVER_DESCRIPTION);
+       printk(KERN_INFO PREFIX "%s\n", ACPI_DOCK_DRIVER_DESCRIPTION);
 
        return 0;
 
@@ -910,6 +917,9 @@ static int __init dock_init(void)
 
        dock_station = NULL;
 
+       if (acpi_disabled)
+               return 0;
+
        /* look for a dock station */
        acpi_walk_namespace(ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
                            ACPI_UINT32_MAX, find_dock, &num, NULL);