X-Git-Url: http://pilppa.org/gitweb/gitweb.cgi?a=blobdiff_plain;f=drivers%2Facpi%2Fbay.c;h=1fa86811b8ee6ee8e5e675666fc1092f0b4c6eb5;hb=6a306e8b4c81a1c1f538e390d92bfe80d04b254c;hp=fb3f31b5e69f6587ff4c7cada15b2291c64fad40;hpb=59b8175c771040afcd4ad67022b0cc80c216b866;p=linux-2.6-omap-h63xx.git diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c index fb3f31b5e69..1fa86811b8e 100644 --- a/drivers/acpi/bay.c +++ b/drivers/acpi/bay.c @@ -46,6 +46,12 @@ MODULE_LICENSE("GPL"); printk(KERN_DEBUG PREFIX "%s: %s\n", prefix, s); } static void bay_notify(acpi_handle handle, u32 event, void *data); +static const struct acpi_device_id bay_device_ids[] = { + {"LNXIOBAY", 0}, + {"", 0}, +}; +MODULE_DEVICE_TABLE(acpi, bay_device_ids); + struct bay { acpi_handle handle; char *name; @@ -128,7 +134,7 @@ static ssize_t show_present(struct device *dev, return snprintf(buf, PAGE_SIZE, "%d\n", bay_present(bay)); } -DEVICE_ATTR(present, S_IRUGO, show_present, NULL); +static DEVICE_ATTR(present, S_IRUGO, show_present, NULL); /* * write_eject - write method for "eject" file in sysfs @@ -144,7 +150,7 @@ static ssize_t write_eject(struct device *dev, struct device_attribute *attr, eject_device(bay->handle); return count; } -DEVICE_ATTR(eject, S_IWUSR, NULL, write_eject); +static DEVICE_ATTR(eject, S_IWUSR, NULL, write_eject); /** * is_ata - see if a device is an ata device @@ -288,6 +294,11 @@ static int bay_add(acpi_handle handle, int id) new_bay->pdev = pdev; platform_set_drvdata(pdev, new_bay); + /* + * we want the bay driver to be able to send uevents + */ + pdev->dev.uevent_suppress = 0; + if (acpi_bay_add_fs(new_bay)) { platform_device_unregister(new_bay->pdev); goto bay_add_err; @@ -328,18 +339,12 @@ static void bay_notify(acpi_handle handle, u32 event, void *data) { struct bay *bay_dev = (struct bay *)data; struct device *dev = &bay_dev->pdev->dev; + char event_string[12]; + char *envp[] = { event_string, NULL }; bay_dprintk(handle, "Bay event"); - - switch(event) { - case ACPI_NOTIFY_BUS_CHECK: - case ACPI_NOTIFY_DEVICE_CHECK: - case ACPI_NOTIFY_EJECT_REQUEST: - kobject_uevent(&dev->kobj, KOBJ_CHANGE); - break; - default: - printk(KERN_ERR PREFIX "Bay: unknown event %d\n", event); - } + sprintf(event_string, "BAY_EVENT=%d", event); + kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp); } static acpi_status