diff options
Diffstat (limited to 'drivers/base')
| -rw-r--r-- | drivers/base/class.c | 1 | ||||
| -rw-r--r-- | drivers/base/core.c | 6 | ||||
| -rw-r--r-- | drivers/base/firmware_class.c | 12 | ||||
| -rw-r--r-- | drivers/base/isa.c | 4 | ||||
| -rw-r--r-- | drivers/base/memory.c | 6 | ||||
| -rw-r--r-- | drivers/base/sys.c | 12 |
6 files changed, 17 insertions, 24 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c index 839d27cecb36..5667c2f02c51 100644 --- a/drivers/base/class.c +++ b/drivers/base/class.c | |||
| @@ -198,6 +198,7 @@ static void class_create_release(struct class *cls) | |||
| 198 | * class_create - create a struct class structure | 198 | * class_create - create a struct class structure |
| 199 | * @owner: pointer to the module that is to "own" this struct class | 199 | * @owner: pointer to the module that is to "own" this struct class |
| 200 | * @name: pointer to a string for the name of this class. | 200 | * @name: pointer to a string for the name of this class. |
| 201 | * @key: the lock_class_key for this class; used by mutex lock debugging | ||
| 201 | * | 202 | * |
| 202 | * This is used to create a struct class pointer that can then be used | 203 | * This is used to create a struct class pointer that can then be used |
| 203 | * in calls to device_create(). | 204 | * in calls to device_create(). |
diff --git a/drivers/base/core.c b/drivers/base/core.c index 7d5c63c81a59..068aa1c9538c 100644 --- a/drivers/base/core.c +++ b/drivers/base/core.c | |||
| @@ -116,12 +116,10 @@ static void device_release(struct kobject *kobj) | |||
| 116 | dev->type->release(dev); | 116 | dev->type->release(dev); |
| 117 | else if (dev->class && dev->class->dev_release) | 117 | else if (dev->class && dev->class->dev_release) |
| 118 | dev->class->dev_release(dev); | 118 | dev->class->dev_release(dev); |
| 119 | else { | 119 | else |
| 120 | printk(KERN_ERR "Device '%s' does not have a release() " | 120 | WARN(1, KERN_ERR "Device '%s' does not have a release() " |
| 121 | "function, it is broken and must be fixed.\n", | 121 | "function, it is broken and must be fixed.\n", |
| 122 | dev->bus_id); | 122 | dev->bus_id); |
| 123 | WARN_ON(1); | ||
| 124 | } | ||
| 125 | } | 123 | } |
| 126 | 124 | ||
| 127 | static struct kobj_type device_ktype = { | 125 | static struct kobj_type device_ktype = { |
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index b0be1d18fee2..c9c92b00fd55 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
| @@ -184,7 +184,7 @@ firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
| 184 | struct device *dev = to_dev(kobj); | 184 | struct device *dev = to_dev(kobj); |
| 185 | struct firmware_priv *fw_priv = dev_get_drvdata(dev); | 185 | struct firmware_priv *fw_priv = dev_get_drvdata(dev); |
| 186 | struct firmware *fw; | 186 | struct firmware *fw; |
| 187 | ssize_t ret_count = count; | 187 | ssize_t ret_count; |
| 188 | 188 | ||
| 189 | mutex_lock(&fw_lock); | 189 | mutex_lock(&fw_lock); |
| 190 | fw = fw_priv->fw; | 190 | fw = fw_priv->fw; |
| @@ -192,14 +192,8 @@ firmware_data_read(struct kobject *kobj, struct bin_attribute *bin_attr, | |||
| 192 | ret_count = -ENODEV; | 192 | ret_count = -ENODEV; |
| 193 | goto out; | 193 | goto out; |
| 194 | } | 194 | } |
| 195 | if (offset > fw->size) { | 195 | ret_count = memory_read_from_buffer(buffer, count, &offset, |
| 196 | ret_count = 0; | 196 | fw->data, fw->size); |
| 197 | goto out; | ||
| 198 | } | ||
| 199 | if (offset + ret_count > fw->size) | ||
| 200 | ret_count = fw->size - offset; | ||
| 201 | |||
| 202 | memcpy(buffer, fw->data + offset, ret_count); | ||
| 203 | out: | 197 | out: |
| 204 | mutex_unlock(&fw_lock); | 198 | mutex_unlock(&fw_lock); |
| 205 | return ret_count; | 199 | return ret_count; |
diff --git a/drivers/base/isa.c b/drivers/base/isa.c index d2222397a401..efd577574948 100644 --- a/drivers/base/isa.c +++ b/drivers/base/isa.c | |||
| @@ -7,6 +7,7 @@ | |||
| 7 | #include <linux/slab.h> | 7 | #include <linux/slab.h> |
| 8 | #include <linux/module.h> | 8 | #include <linux/module.h> |
| 9 | #include <linux/init.h> | 9 | #include <linux/init.h> |
| 10 | #include <linux/dma-mapping.h> | ||
| 10 | #include <linux/isa.h> | 11 | #include <linux/isa.h> |
| 11 | 12 | ||
| 12 | static struct device isa_bus = { | 13 | static struct device isa_bus = { |
| @@ -141,6 +142,9 @@ int isa_register_driver(struct isa_driver *isa_driver, unsigned int ndev) | |||
| 141 | isa_dev->dev.release = isa_dev_release; | 142 | isa_dev->dev.release = isa_dev_release; |
| 142 | isa_dev->id = id; | 143 | isa_dev->id = id; |
| 143 | 144 | ||
| 145 | isa_dev->dev.coherent_dma_mask = DMA_24BIT_MASK; | ||
| 146 | isa_dev->dev.dma_mask = &isa_dev->dev.coherent_dma_mask; | ||
| 147 | |||
| 144 | error = device_register(&isa_dev->dev); | 148 | error = device_register(&isa_dev->dev); |
| 145 | if (error) { | 149 | if (error) { |
| 146 | put_device(&isa_dev->dev); | 150 | put_device(&isa_dev->dev); |
diff --git a/drivers/base/memory.c b/drivers/base/memory.c index 855ed1a9f97b..af0d175c025d 100644 --- a/drivers/base/memory.c +++ b/drivers/base/memory.c | |||
| @@ -103,7 +103,8 @@ static ssize_t show_mem_phys_index(struct sys_device *dev, | |||
| 103 | /* | 103 | /* |
| 104 | * Show whether the section of memory is likely to be hot-removable | 104 | * Show whether the section of memory is likely to be hot-removable |
| 105 | */ | 105 | */ |
| 106 | static ssize_t show_mem_removable(struct sys_device *dev, char *buf) | 106 | static ssize_t show_mem_removable(struct sys_device *dev, |
| 107 | struct sysdev_attribute *attr, char *buf) | ||
| 107 | { | 108 | { |
| 108 | unsigned long start_pfn; | 109 | unsigned long start_pfn; |
| 109 | int ret; | 110 | int ret; |
| @@ -204,9 +205,8 @@ memory_block_action(struct memory_block *mem, unsigned long action) | |||
| 204 | } | 205 | } |
| 205 | break; | 206 | break; |
| 206 | default: | 207 | default: |
| 207 | printk(KERN_WARNING "%s(%p, %ld) unknown action: %ld\n", | 208 | WARN(1, KERN_WARNING "%s(%p, %ld) unknown action: %ld\n", |
| 208 | __func__, mem, action, action); | 209 | __func__, mem, action, action); |
| 209 | WARN_ON(1); | ||
| 210 | ret = -EINVAL; | 210 | ret = -EINVAL; |
| 211 | } | 211 | } |
| 212 | 212 | ||
diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 40fc14f03540..75dd6e22faff 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c | |||
| @@ -168,19 +168,16 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv) | |||
| 168 | int err = 0; | 168 | int err = 0; |
| 169 | 169 | ||
| 170 | if (!cls) { | 170 | if (!cls) { |
| 171 | printk(KERN_WARNING "sysdev: invalid class passed to " | 171 | WARN(1, KERN_WARNING "sysdev: invalid class passed to " |
| 172 | "sysdev_driver_register!\n"); | 172 | "sysdev_driver_register!\n"); |
| 173 | WARN_ON(1); | ||
| 174 | return -EINVAL; | 173 | return -EINVAL; |
| 175 | } | 174 | } |
| 176 | 175 | ||
| 177 | /* Check whether this driver has already been added to a class. */ | 176 | /* Check whether this driver has already been added to a class. */ |
| 178 | if (drv->entry.next && !list_empty(&drv->entry)) { | 177 | if (drv->entry.next && !list_empty(&drv->entry)) |
| 179 | printk(KERN_WARNING "sysdev: class %s: driver (%p) has already" | 178 | WARN(1, KERN_WARNING "sysdev: class %s: driver (%p) has already" |
| 180 | " been registered to a class, something is wrong, but " | 179 | " been registered to a class, something is wrong, but " |
| 181 | "will forge on!\n", cls->name, drv); | 180 | "will forge on!\n", cls->name, drv); |
| 182 | WARN_ON(1); | ||
| 183 | } | ||
| 184 | 181 | ||
| 185 | mutex_lock(&sysdev_drivers_lock); | 182 | mutex_lock(&sysdev_drivers_lock); |
| 186 | if (cls && kset_get(&cls->kset)) { | 183 | if (cls && kset_get(&cls->kset)) { |
| @@ -194,8 +191,7 @@ int sysdev_driver_register(struct sysdev_class *cls, struct sysdev_driver *drv) | |||
| 194 | } | 191 | } |
| 195 | } else { | 192 | } else { |
| 196 | err = -EINVAL; | 193 | err = -EINVAL; |
| 197 | printk(KERN_ERR "%s: invalid device class\n", __func__); | 194 | WARN(1, KERN_ERR "%s: invalid device class\n", __func__); |
| 198 | WARN_ON(1); | ||
| 199 | } | 195 | } |
| 200 | mutex_unlock(&sysdev_drivers_lock); | 196 | mutex_unlock(&sysdev_drivers_lock); |
| 201 | return err; | 197 | return err; |
