aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/char
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/char')
-rw-r--r--drivers/char/agp/backend.c3
-rw-r--r--drivers/char/apm-emulation.c21
-rw-r--r--drivers/char/raw.c3
-rw-r--r--drivers/char/rtc.c7
-rw-r--r--drivers/char/tpm/tpm.c3
5 files changed, 15 insertions, 22 deletions
diff --git a/drivers/char/agp/backend.c b/drivers/char/agp/backend.c
index f27d0d0816d3..4b71647782d0 100644
--- a/drivers/char/agp/backend.c
+++ b/drivers/char/agp/backend.c
@@ -171,7 +171,7 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
171 } 171 }
172 got_gatt = 1; 172 got_gatt = 1;
173 173
174 bridge->key_list = vmalloc(PAGE_SIZE * 4); 174 bridge->key_list = vzalloc(PAGE_SIZE * 4);
175 if (bridge->key_list == NULL) { 175 if (bridge->key_list == NULL) {
176 dev_err(&bridge->dev->dev, 176 dev_err(&bridge->dev->dev,
177 "can't allocate memory for key lists\n"); 177 "can't allocate memory for key lists\n");
@@ -181,7 +181,6 @@ static int agp_backend_initialize(struct agp_bridge_data *bridge)
181 got_keylist = 1; 181 got_keylist = 1;
182 182
183 /* FIXME vmalloc'd memory not guaranteed contiguous */ 183 /* FIXME vmalloc'd memory not guaranteed contiguous */
184 memset(bridge->key_list, 0, PAGE_SIZE * 4);
185 184
186 if (bridge->driver->configure()) { 185 if (bridge->driver->configure()) {
187 dev_err(&bridge->dev->dev, "error configuring host chipset\n"); 186 dev_err(&bridge->dev->dev, "error configuring host chipset\n");
diff --git a/drivers/char/apm-emulation.c b/drivers/char/apm-emulation.c
index a7346ab97a3c..f4837a893dfa 100644
--- a/drivers/char/apm-emulation.c
+++ b/drivers/char/apm-emulation.c
@@ -40,10 +40,7 @@
40#define APM_MINOR_DEV 134 40#define APM_MINOR_DEV 134
41 41
42/* 42/*
43 * See Documentation/Config.help for the configuration options. 43 * One option can be changed at boot time as follows:
44 *
45 * Various options can be changed at boot time as follows:
46 * (We allow underscores for compatibility with the modules code)
47 * apm=on/off enable/disable APM 44 * apm=on/off enable/disable APM
48 */ 45 */
49 46
@@ -300,17 +297,13 @@ apm_ioctl(struct file *filp, u_int cmd, u_long arg)
300 /* 297 /*
301 * Wait for the suspend/resume to complete. If there 298 * Wait for the suspend/resume to complete. If there
302 * are pending acknowledges, we wait here for them. 299 * are pending acknowledges, we wait here for them.
300 * wait_event_freezable() is interruptible and pending
301 * signal can cause busy looping. We aren't doing
302 * anything critical, chill a bit on each iteration.
303 */ 303 */
304 freezer_do_not_count(); 304 while (wait_event_freezable(apm_suspend_waitqueue,
305 305 as->suspend_state == SUSPEND_DONE))
306 wait_event(apm_suspend_waitqueue, 306 msleep(10);
307 as->suspend_state == SUSPEND_DONE);
308
309 /*
310 * Since we are waiting until the suspend is done, the
311 * try_to_freeze() in freezer_count() will not trigger
312 */
313 freezer_count();
314 break; 307 break;
315 case SUSPEND_ACKTO: 308 case SUSPEND_ACKTO:
316 as->suspend_result = -ETIMEDOUT; 309 as->suspend_result = -ETIMEDOUT;
diff --git a/drivers/char/raw.c b/drivers/char/raw.c
index b33e8ea314ed..b6de2c047145 100644
--- a/drivers/char/raw.c
+++ b/drivers/char/raw.c
@@ -324,13 +324,12 @@ static int __init raw_init(void)
324 max_raw_minors = MAX_RAW_MINORS; 324 max_raw_minors = MAX_RAW_MINORS;
325 } 325 }
326 326
327 raw_devices = vmalloc(sizeof(struct raw_device_data) * max_raw_minors); 327 raw_devices = vzalloc(sizeof(struct raw_device_data) * max_raw_minors);
328 if (!raw_devices) { 328 if (!raw_devices) {
329 printk(KERN_ERR "Not enough memory for raw device structures\n"); 329 printk(KERN_ERR "Not enough memory for raw device structures\n");
330 ret = -ENOMEM; 330 ret = -ENOMEM;
331 goto error; 331 goto error;
332 } 332 }
333 memset(raw_devices, 0, sizeof(struct raw_device_data) * max_raw_minors);
334 333
335 ret = register_chrdev_region(dev, max_raw_minors, "raw"); 334 ret = register_chrdev_region(dev, max_raw_minors, "raw");
336 if (ret) 335 if (ret)
diff --git a/drivers/char/rtc.c b/drivers/char/rtc.c
index dfa8b3062fda..ccd124ab7ca7 100644
--- a/drivers/char/rtc.c
+++ b/drivers/char/rtc.c
@@ -80,6 +80,7 @@
80#include <linux/bcd.h> 80#include <linux/bcd.h>
81#include <linux/delay.h> 81#include <linux/delay.h>
82#include <linux/uaccess.h> 82#include <linux/uaccess.h>
83#include <linux/ratelimit.h>
83 84
84#include <asm/current.h> 85#include <asm/current.h>
85#include <asm/system.h> 86#include <asm/system.h>
@@ -1195,10 +1196,8 @@ static void rtc_dropped_irq(unsigned long data)
1195 1196
1196 spin_unlock_irq(&rtc_lock); 1197 spin_unlock_irq(&rtc_lock);
1197 1198
1198 if (printk_ratelimit()) { 1199 printk_ratelimited(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n",
1199 printk(KERN_WARNING "rtc: lost some interrupts at %ldHz.\n", 1200 freq);
1200 freq);
1201 }
1202 1201
1203 /* Now we have new data */ 1202 /* Now we have new data */
1204 wake_up_interruptible(&rtc_wait); 1203 wake_up_interruptible(&rtc_wait);
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 9ca5c021d0b6..361a1dff8f77 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -966,6 +966,9 @@ ssize_t tpm_show_durations(struct device *dev, struct device_attribute *attr,
966{ 966{
967 struct tpm_chip *chip = dev_get_drvdata(dev); 967 struct tpm_chip *chip = dev_get_drvdata(dev);
968 968
969 if (chip->vendor.duration[TPM_LONG] == 0)
970 return 0;
971
969 return sprintf(buf, "%d %d %d [%s]\n", 972 return sprintf(buf, "%d %d %d [%s]\n",
970 jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]), 973 jiffies_to_usecs(chip->vendor.duration[TPM_SHORT]),
971 jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]), 974 jiffies_to_usecs(chip->vendor.duration[TPM_MEDIUM]),