lockd: convert nsm_mutex to a spinlock
[safe/jmp/linux-2.6] / drivers / firmware / dcdbas.c
index 339f405..f235940 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
 #include <linux/types.h>
 #include <linux/mutex.h>
 #include <asm/io.h>
-#include <asm/semaphore.h>
 
 #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;
@@ -149,8 +148,9 @@ static ssize_t smi_data_buf_size_store(struct device *dev,
        return count;
 }
 
-static ssize_t smi_data_read(struct kobject *kobj, char *buf, loff_t pos,
-                            size_t count)
+static ssize_t smi_data_read(struct kobject *kobj,
+                            struct bin_attribute *bin_attr,
+                            char *buf, loff_t pos, size_t count)
 {
        size_t max_read;
        ssize_t ret;
@@ -170,11 +170,15 @@ out:
        return ret;
 }
 
-static ssize_t smi_data_write(struct kobject *kobj, char *buf, loff_t pos,
-                             size_t count)
+static ssize_t smi_data_write(struct kobject *kobj,
+                             struct bin_attribute *bin_attr,
+                             char *buf, loff_t pos, size_t count)
 {
        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);
@@ -260,7 +264,7 @@ static int smi_request(struct smi_cmd *smi_cmd)
 
        /* SMI requires CPU 0 */
        old_mask = current->cpus_allowed;
-       set_cpus_allowed(current, cpumask_of_cpu(0));
+       set_cpus_allowed_ptr(current, &cpumask_of_cpu(0));
        if (smp_processor_id() != 0) {
                dev_dbg(&dcdbas_pdev->dev, "%s: failed to get CPU 0\n",
                        __FUNCTION__);
@@ -280,7 +284,7 @@ static int smi_request(struct smi_cmd *smi_cmd)
        );
 
 out:
-       set_cpus_allowed(current, old_mask);
+       set_cpus_allowed_ptr(current, &old_mask);
        return ret;
 }
 
@@ -559,7 +563,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;
                }
        }
@@ -653,4 +657,5 @@ MODULE_DESCRIPTION(DRIVER_DESCRIPTION " (version " DRIVER_VERSION ")");
 MODULE_VERSION(DRIVER_VERSION);
 MODULE_AUTHOR("Dell Inc.");
 MODULE_LICENSE("GPL");
-
+/* Any System or BIOS claiming to be by Dell */
+MODULE_ALIAS("dmi:*:[bs]vnD[Ee][Ll][Ll]*:*");