ACPI: bay: send envp with uevent - fix

2007-08-12 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=7aa763cb56b6efdfa5c1b83c336abf1be914afcd
Commit: 7aa763cb56b6efdfa5c1b83c336abf1be914afcd
Parent: 3864e8ccbba1dcdea87398ab80fdc8ae0fab7c45
Author: Stephan Berberig <[EMAIL PROTECTED]>
AuthorDate: Fri Aug 10 13:10:31 2007 -0700
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Sat Aug 11 22:10:04 2007 -0400

    ACPI: bay: send envp with uevent - fix

There must not be a new-line character in the uevent.  Otherwise, udev gets
confused.  Thanks to Kay Sievers for pointing it out.

Signed-off-by: Stephan Berberig <[EMAIL PROTECTED]>
Cc: Kristen Carlson Accardi <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Acked-by: Greg Kroah-Hartman <[EMAIL PROTECTED]>
Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/bay.c |2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c
index 56a5b3f..6daf608 100644
--- a/drivers/acpi/bay.c
+++ b/drivers/acpi/bay.c
@@ -337,7 +337,7 @@ static void bay_notify(acpi_handle handle, u32 event, void 
*data)
char *envp[] = { event_string, NULL };
 
bay_dprintk(handle, "Bay event");
-   sprintf(event_string, "BAY_EVENT=%d\n", event);
+   sprintf(event_string, "BAY_EVENT=%d", event);
kobject_uevent_env(&dev->kobj, KOBJ_CHANGE, envp);
 }
 
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html


ACPI: bay: send envp with uevent

2007-07-22 Thread Linux Kernel Mailing List
Gitweb: 
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=3f8698d4d3f72252980575fb8d7b4cafeb5dd0a2
Commit: 3f8698d4d3f72252980575fb8d7b4cafeb5dd0a2
Parent: 1f9767df1346c9ce09d6e51b9f34b851e3d94fad
Author: Kristen Carlson Accardi <[EMAIL PROTECTED]>
AuthorDate: Wed May 23 14:12:29 2007 -0700
Committer:  Len Brown <[EMAIL PROTECTED]>
CommitDate: Sat Jun 2 00:37:54 2007 -0400

    ACPI: bay: send envp with uevent

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 <[EMAIL PROTECTED]>
Cc: Stephan Berberig <[EMAIL PROTECTED]>
Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
Signed-off-by: Len Brown <[EMAIL PROTECTED]>
---
 drivers/acpi/bay.c |   14 --
 1 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/drivers/acpi/bay.c b/drivers/acpi/bay.c
index 00d3f3f..56a5b3f 100644
--- a/drivers/acpi/bay.c
+++ b/drivers/acpi/bay.c
@@ -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
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html