Skip to content

Commit

Permalink
ACPI: bay: send envp with uevent
Browse files Browse the repository at this point in the history
Make the bay driver send env information on bay events.

Upon any bay event, we will send the string "BAY_EVENT=%d" along with the
KOBJ_CHANGE, and report the event number.  What the event number means will
be platform specific.  Event 3 is always an eject request, but an insert
may be either event 1, or it may be event 0.  Event 1 may also be a
remove request.  It would be best if you check the number of your event
with udevmonitor before writing any udev scripts for inserting and
removing drive bays.

Signed-off-by: Kristen Carlson Accardi <kristen.c.accardi@intel.com>
Cc: Stephan Berberig <s.berberig@arcor.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Len Brown <len.brown@intel.com>
  • Loading branch information
Kristen Carlson Accardi authored and Len Brown committed Jun 2, 2007
1 parent 1f9767d commit 3f8698d
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions drivers/acpi/bay.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,18 +333,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\n", event);
kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);
}

static acpi_status
Expand Down

0 comments on commit 3f8698d

Please sign in to comment.