NFS: Kill the obsolete NFS_PARANOIA
[powerpc.git] / drivers / firmware / dcdbas.c
index d6543fc..1865b56 100644 (file)
@@ -8,7 +8,7 @@
  *
  *  See Documentation/dcdbas.txt for more information.
  *
- *  Copyright (C) 1995-2005 Dell Inc.
+ *  Copyright (C) 1995-2006 Dell Inc.
  *
  *  This program is free software; you can redistribute it and/or modify
  *  it under the terms of the GNU General Public License v2.0 as published by
@@ -40,7 +40,7 @@
 #include "dcdbas.h"
 
 #define DRIVER_NAME            "dcdbas"
-#define DRIVER_VERSION         "5.6.0-2"
+#define DRIVER_VERSION         "5.6.0-3.2"
 #define DRIVER_DESCRIPTION     "Dell Systems Management Base Driver"
 
 static struct platform_device *dcdbas_pdev;
@@ -175,6 +175,9 @@ static ssize_t smi_data_write(struct kobject *kobj, char *buf, loff_t pos,
 {
        ssize_t ret;
 
+       if ((pos + count) > MAX_SMI_DATA_BUF_SIZE)
+               return -EINVAL;
+
        mutex_lock(&smi_data_lock);
 
        ret = smi_data_buf_realloc(pos + count);
@@ -484,26 +487,15 @@ static void dcdbas_host_control(void)
 static int dcdbas_reboot_notify(struct notifier_block *nb, unsigned long code,
                                void *unused)
 {
-       static unsigned int notify_cnt = 0;
-
        switch (code) {
        case SYS_DOWN:
        case SYS_HALT:
        case SYS_POWER_OFF:
                if (host_control_on_shutdown) {
                        /* firmware is going to perform host control action */
-                       if (++notify_cnt == 2) {
-                               printk(KERN_WARNING
-                                      "Please wait for shutdown "
-                                      "action to complete...\n");
-                               dcdbas_host_control();
-                       }
-                       /*
-                        * register again and initiate the host control
-                        * action on the second notification to allow
-                        * everyone that registered to be notified
-                        */
-                       register_reboot_notifier(nb);
+                       printk(KERN_WARNING "Please wait for shutdown "
+                              "action to complete...\n");
+                       dcdbas_host_control();
                }
                break;
        }
@@ -514,7 +506,7 @@ static int dcdbas_reboot_notify(struct notifier_block *nb, unsigned long code,
 static struct notifier_block dcdbas_reboot_nb = {
        .notifier_call = dcdbas_reboot_notify,
        .next = NULL,
-       .priority = 0
+       .priority = INT_MIN
 };
 
 static DCDBAS_BIN_ATTR_RW(smi_data);
@@ -570,7 +562,7 @@ static int __devinit dcdbas_probe(struct platform_device *dev)
                        while (--i >= 0)
                                sysfs_remove_bin_file(&dev->dev.kobj,
                                                      dcdbas_bin_attrs[i]);
-                       sysfs_create_group(&dev->dev.kobj, &dcdbas_attr_group);
+                       sysfs_remove_group(&dev->dev.kobj, &dcdbas_attr_group);
                        return error;
                }
        }