patch-2.4.10 linux/drivers/acpi/ospm/button/bn_osl.c

Next file: linux/drivers/acpi/ospm/ec/ec_osl.c
Previous file: linux/drivers/acpi/ospm/button/bn.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.9/linux/drivers/acpi/ospm/button/bn_osl.c linux/drivers/acpi/ospm/button/bn_osl.c
@@ -1,7 +1,7 @@
 /******************************************************************************
  *
  * Module Name: bn_osl.c
- *   $Revision: 10 $
+ *   $Revision: 14 $
  *
  *****************************************************************************/
 
@@ -35,6 +35,7 @@
 
 MODULE_AUTHOR("Andrew Grover");
 MODULE_DESCRIPTION("ACPI Component Architecture (CA) - Button Driver");
+MODULE_LICENSE("GPL");
 
 
 #define BN_PROC_ROOT		"button"
@@ -52,11 +53,11 @@
  *
  ****************************************************************************/
 
-ACPI_STATUS
+acpi_status
 bn_osl_add_device(
 	BN_CONTEXT		*button)
 {
-	ACPI_STATUS		status = AE_OK;
+	acpi_status		status = AE_OK;
 
 	if (!button) {
 		return(AE_BAD_PARAMETER);
@@ -98,7 +99,7 @@
  *
  ****************************************************************************/
 
-ACPI_STATUS
+acpi_status
 bn_osl_remove_device (
 	BN_CONTEXT		*button)
 {
@@ -133,12 +134,12 @@
  *
  ****************************************************************************/
 
-ACPI_STATUS
+acpi_status
 bn_osl_generate_event (
 	u32			event,
 	BN_CONTEXT		*button)
 {
-	ACPI_STATUS		status = AE_OK;
+	acpi_status		status = AE_OK;
 
 	if (!button) {
 		return(AE_BAD_PARAMETER);
@@ -195,10 +196,14 @@
  *
  ****************************************************************************/
 
-static int __init 
+static int __init
 bn_osl_init (void)
 {
-	ACPI_STATUS		status = AE_OK;
+	acpi_status		status = AE_OK;
+
+	/* abort if no busmgr */
+	if (!bm_proc_root)
+		return -ENODEV;
 
 	bn_proc_root = proc_mkdir(BN_PROC_ROOT, bm_proc_root);
 	if (!bn_proc_root) {
@@ -227,7 +232,7 @@
  *
  ****************************************************************************/
 
-static void __exit 
+static void __exit
 bn_osl_cleanup (void)
 {
 	bn_terminate();

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)