diff options
author | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 12:25:15 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-03-21 12:25:15 -0500 |
commit | 08a4ecee986dd98e86090ff5faac4782b6765aed (patch) | |
tree | 74df5de49f38c432a6a18303b0c6d834fd09028f /drivers | |
parent | ba93c6297b9cfad5a70b5e5ed13c9dbead6601d3 (diff) | |
parent | b3229087c5e08589cea4f5040dab56f7dc11332a (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/gregkh/driver-2.6: (23 commits)
[PATCH] sysfs: fix a kobject leak in sysfs_add_link on the error path
[PATCH] sysfs: don't export dir symbols
[PATCH] get_cpu_sysdev() signedness fix
[PATCH] kobject_add_dir
[PATCH] debugfs: Add debugfs_create_blob() helper for exporting binary data
[PATCH] sysfs: fix problem with duplicate sysfs directories and files
[PATCH] Kobject: kobject.h: fix a typo
[PATCH] Kobject: provide better warning messages when people do stupid things
[PATCH] Driver core: add macros notice(), dev_notice()
[PATCH] firmware: fix BUG: in fw_realloc_buffer
[PATCH] sysfs: kzalloc conversion
[PATCH] fix module sysfs files reference counting
[PATCH] add EXPORT_SYMBOL_GPL_FUTURE() to USB subsystem
[PATCH] add EXPORT_SYMBOL_GPL_FUTURE() to RCU subsystem
[PATCH] add EXPORT_SYMBOL_GPL_FUTURE()
[PATCH] Clean up module.c symbol searching logic
[PATCH] kobj_map semaphore to mutex conversion
[PATCH] kref: avoid an atomic operation in kref_put()
[PATCH] handle errors returned by platform_get_irq*()
[PATCH] driver core: platform_get_irq*(): return -ENXIO on error
...
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/base/cpu.c | 2 | ||||
-rw-r--r-- | drivers/base/firmware_class.c | 6 | ||||
-rw-r--r-- | drivers/base/map.c | 21 | ||||
-rw-r--r-- | drivers/base/platform.c | 4 | ||||
-rw-r--r-- | drivers/char/s3c2410-rtc.c | 4 | ||||
-rw-r--r-- | drivers/char/watchdog/mpcore_wdt.c | 4 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-iop3xx.c | 9 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mpc.c | 5 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mv64xxx.c | 4 | ||||
-rw-r--r-- | drivers/ide/mips/au1xxx-ide.c | 5 | ||||
-rw-r--r-- | drivers/mmc/pxamci.c | 2 | ||||
-rw-r--r-- | drivers/net/arm/am79c961a.c | 4 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-fcc.c | 2 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-fec.c | 2 | ||||
-rw-r--r-- | drivers/net/fs_enet/mac-scc.c | 2 | ||||
-rw-r--r-- | drivers/net/gianfar.c | 4 | ||||
-rw-r--r-- | drivers/net/smc91x.c | 4 | ||||
-rw-r--r-- | drivers/pcmcia/omap_cf.c | 2 | ||||
-rw-r--r-- | drivers/serial/s3c2410.c | 2 | ||||
-rw-r--r-- | drivers/usb/core/driver.c | 6 | ||||
-rw-r--r-- | drivers/usb/host/ohci-omap.c | 9 | ||||
-rw-r--r-- | drivers/video/epson1355fb.c | 1 | ||||
-rw-r--r-- | drivers/video/sa1100fb.c | 2 | ||||
-rw-r--r-- | drivers/video/vfb.c | 1 |
24 files changed, 79 insertions, 28 deletions
diff --git a/drivers/base/cpu.c b/drivers/base/cpu.c index 07a7f97e1de9..29f3d7504da1 100644 --- a/drivers/base/cpu.c +++ b/drivers/base/cpu.c | |||
@@ -141,7 +141,7 @@ int __devinit register_cpu(struct cpu *cpu, int num, struct node *root) | |||
141 | return error; | 141 | return error; |
142 | } | 142 | } |
143 | 143 | ||
144 | struct sys_device *get_cpu_sysdev(int cpu) | 144 | struct sys_device *get_cpu_sysdev(unsigned cpu) |
145 | { | 145 | { |
146 | if (cpu < NR_CPUS) | 146 | if (cpu < NR_CPUS) |
147 | return cpu_sys_devices[cpu]; | 147 | return cpu_sys_devices[cpu]; |
diff --git a/drivers/base/firmware_class.c b/drivers/base/firmware_class.c index e97e911ebf7a..472318205236 100644 --- a/drivers/base/firmware_class.c +++ b/drivers/base/firmware_class.c | |||
@@ -211,18 +211,20 @@ static int | |||
211 | fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size) | 211 | fw_realloc_buffer(struct firmware_priv *fw_priv, int min_size) |
212 | { | 212 | { |
213 | u8 *new_data; | 213 | u8 *new_data; |
214 | int new_size = fw_priv->alloc_size; | ||
214 | 215 | ||
215 | if (min_size <= fw_priv->alloc_size) | 216 | if (min_size <= fw_priv->alloc_size) |
216 | return 0; | 217 | return 0; |
217 | 218 | ||
218 | new_data = vmalloc(fw_priv->alloc_size + PAGE_SIZE); | 219 | new_size = ALIGN(min_size, PAGE_SIZE); |
220 | new_data = vmalloc(new_size); | ||
219 | if (!new_data) { | 221 | if (!new_data) { |
220 | printk(KERN_ERR "%s: unable to alloc buffer\n", __FUNCTION__); | 222 | printk(KERN_ERR "%s: unable to alloc buffer\n", __FUNCTION__); |
221 | /* Make sure that we don't keep incomplete data */ | 223 | /* Make sure that we don't keep incomplete data */ |
222 | fw_load_abort(fw_priv); | 224 | fw_load_abort(fw_priv); |
223 | return -ENOMEM; | 225 | return -ENOMEM; |
224 | } | 226 | } |
225 | fw_priv->alloc_size += PAGE_SIZE; | 227 | fw_priv->alloc_size = new_size; |
226 | if (fw_priv->fw->data) { | 228 | if (fw_priv->fw->data) { |
227 | memcpy(new_data, fw_priv->fw->data, fw_priv->fw->size); | 229 | memcpy(new_data, fw_priv->fw->data, fw_priv->fw->size); |
228 | vfree(fw_priv->fw->data); | 230 | vfree(fw_priv->fw->data); |
diff --git a/drivers/base/map.c b/drivers/base/map.c index b449dae6f0d3..e87017f36853 100644 --- a/drivers/base/map.c +++ b/drivers/base/map.c | |||
@@ -11,6 +11,7 @@ | |||
11 | 11 | ||
12 | #include <linux/module.h> | 12 | #include <linux/module.h> |
13 | #include <linux/slab.h> | 13 | #include <linux/slab.h> |
14 | #include <linux/mutex.h> | ||
14 | #include <linux/kdev_t.h> | 15 | #include <linux/kdev_t.h> |
15 | #include <linux/kobject.h> | 16 | #include <linux/kobject.h> |
16 | #include <linux/kobj_map.h> | 17 | #include <linux/kobj_map.h> |
@@ -25,7 +26,7 @@ struct kobj_map { | |||
25 | int (*lock)(dev_t, void *); | 26 | int (*lock)(dev_t, void *); |
26 | void *data; | 27 | void *data; |
27 | } *probes[255]; | 28 | } *probes[255]; |
28 | struct semaphore *sem; | 29 | struct mutex *lock; |
29 | }; | 30 | }; |
30 | 31 | ||
31 | int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range, | 32 | int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range, |
@@ -53,7 +54,7 @@ int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range, | |||
53 | p->range = range; | 54 | p->range = range; |
54 | p->data = data; | 55 | p->data = data; |
55 | } | 56 | } |
56 | down(domain->sem); | 57 | mutex_lock(domain->lock); |
57 | for (i = 0, p -= n; i < n; i++, p++, index++) { | 58 | for (i = 0, p -= n; i < n; i++, p++, index++) { |
58 | struct probe **s = &domain->probes[index % 255]; | 59 | struct probe **s = &domain->probes[index % 255]; |
59 | while (*s && (*s)->range < range) | 60 | while (*s && (*s)->range < range) |
@@ -61,7 +62,7 @@ int kobj_map(struct kobj_map *domain, dev_t dev, unsigned long range, | |||
61 | p->next = *s; | 62 | p->next = *s; |
62 | *s = p; | 63 | *s = p; |
63 | } | 64 | } |
64 | up(domain->sem); | 65 | mutex_unlock(domain->lock); |
65 | return 0; | 66 | return 0; |
66 | } | 67 | } |
67 | 68 | ||
@@ -75,7 +76,7 @@ void kobj_unmap(struct kobj_map *domain, dev_t dev, unsigned long range) | |||
75 | if (n > 255) | 76 | if (n > 255) |
76 | n = 255; | 77 | n = 255; |
77 | 78 | ||
78 | down(domain->sem); | 79 | mutex_lock(domain->lock); |
79 | for (i = 0; i < n; i++, index++) { | 80 | for (i = 0; i < n; i++, index++) { |
80 | struct probe **s; | 81 | struct probe **s; |
81 | for (s = &domain->probes[index % 255]; *s; s = &(*s)->next) { | 82 | for (s = &domain->probes[index % 255]; *s; s = &(*s)->next) { |
@@ -88,7 +89,7 @@ void kobj_unmap(struct kobj_map *domain, dev_t dev, unsigned long range) | |||
88 | } | 89 | } |
89 | } | 90 | } |
90 | } | 91 | } |
91 | up(domain->sem); | 92 | mutex_unlock(domain->lock); |
92 | kfree(found); | 93 | kfree(found); |
93 | } | 94 | } |
94 | 95 | ||
@@ -99,7 +100,7 @@ struct kobject *kobj_lookup(struct kobj_map *domain, dev_t dev, int *index) | |||
99 | unsigned long best = ~0UL; | 100 | unsigned long best = ~0UL; |
100 | 101 | ||
101 | retry: | 102 | retry: |
102 | down(domain->sem); | 103 | mutex_lock(domain->lock); |
103 | for (p = domain->probes[MAJOR(dev) % 255]; p; p = p->next) { | 104 | for (p = domain->probes[MAJOR(dev) % 255]; p; p = p->next) { |
104 | struct kobject *(*probe)(dev_t, int *, void *); | 105 | struct kobject *(*probe)(dev_t, int *, void *); |
105 | struct module *owner; | 106 | struct module *owner; |
@@ -120,7 +121,7 @@ retry: | |||
120 | module_put(owner); | 121 | module_put(owner); |
121 | continue; | 122 | continue; |
122 | } | 123 | } |
123 | up(domain->sem); | 124 | mutex_unlock(domain->lock); |
124 | kobj = probe(dev, index, data); | 125 | kobj = probe(dev, index, data); |
125 | /* Currently ->owner protects _only_ ->probe() itself. */ | 126 | /* Currently ->owner protects _only_ ->probe() itself. */ |
126 | module_put(owner); | 127 | module_put(owner); |
@@ -128,11 +129,11 @@ retry: | |||
128 | return kobj; | 129 | return kobj; |
129 | goto retry; | 130 | goto retry; |
130 | } | 131 | } |
131 | up(domain->sem); | 132 | mutex_unlock(domain->lock); |
132 | return NULL; | 133 | return NULL; |
133 | } | 134 | } |
134 | 135 | ||
135 | struct kobj_map *kobj_map_init(kobj_probe_t *base_probe, struct semaphore *sem) | 136 | struct kobj_map *kobj_map_init(kobj_probe_t *base_probe, struct mutex *lock) |
136 | { | 137 | { |
137 | struct kobj_map *p = kmalloc(sizeof(struct kobj_map), GFP_KERNEL); | 138 | struct kobj_map *p = kmalloc(sizeof(struct kobj_map), GFP_KERNEL); |
138 | struct probe *base = kzalloc(sizeof(*base), GFP_KERNEL); | 139 | struct probe *base = kzalloc(sizeof(*base), GFP_KERNEL); |
@@ -149,6 +150,6 @@ struct kobj_map *kobj_map_init(kobj_probe_t *base_probe, struct semaphore *sem) | |||
149 | base->get = base_probe; | 150 | base->get = base_probe; |
150 | for (i = 0; i < 255; i++) | 151 | for (i = 0; i < 255; i++) |
151 | p->probes[i] = base; | 152 | p->probes[i] = base; |
152 | p->sem = sem; | 153 | p->lock = lock; |
153 | return p; | 154 | return p; |
154 | } | 155 | } |
diff --git a/drivers/base/platform.c b/drivers/base/platform.c index 461554a02517..89b268321321 100644 --- a/drivers/base/platform.c +++ b/drivers/base/platform.c | |||
@@ -61,7 +61,7 @@ int platform_get_irq(struct platform_device *dev, unsigned int num) | |||
61 | { | 61 | { |
62 | struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); | 62 | struct resource *r = platform_get_resource(dev, IORESOURCE_IRQ, num); |
63 | 63 | ||
64 | return r ? r->start : 0; | 64 | return r ? r->start : -ENXIO; |
65 | } | 65 | } |
66 | EXPORT_SYMBOL_GPL(platform_get_irq); | 66 | EXPORT_SYMBOL_GPL(platform_get_irq); |
67 | 67 | ||
@@ -98,7 +98,7 @@ int platform_get_irq_byname(struct platform_device *dev, char *name) | |||
98 | { | 98 | { |
99 | struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); | 99 | struct resource *r = platform_get_resource_byname(dev, IORESOURCE_IRQ, name); |
100 | 100 | ||
101 | return r ? r->start : 0; | 101 | return r ? r->start : -ENXIO; |
102 | } | 102 | } |
103 | EXPORT_SYMBOL_GPL(platform_get_irq_byname); | 103 | EXPORT_SYMBOL_GPL(platform_get_irq_byname); |
104 | 104 | ||
diff --git a/drivers/char/s3c2410-rtc.c b/drivers/char/s3c2410-rtc.c index 2e308657f6f6..b0038b19b505 100644 --- a/drivers/char/s3c2410-rtc.c +++ b/drivers/char/s3c2410-rtc.c | |||
@@ -448,13 +448,13 @@ static int s3c2410_rtc_probe(struct platform_device *pdev) | |||
448 | /* find the IRQs */ | 448 | /* find the IRQs */ |
449 | 449 | ||
450 | s3c2410_rtc_tickno = platform_get_irq(pdev, 1); | 450 | s3c2410_rtc_tickno = platform_get_irq(pdev, 1); |
451 | if (s3c2410_rtc_tickno <= 0) { | 451 | if (s3c2410_rtc_tickno < 0) { |
452 | dev_err(&pdev->dev, "no irq for rtc tick\n"); | 452 | dev_err(&pdev->dev, "no irq for rtc tick\n"); |
453 | return -ENOENT; | 453 | return -ENOENT; |
454 | } | 454 | } |
455 | 455 | ||
456 | s3c2410_rtc_alarmno = platform_get_irq(pdev, 0); | 456 | s3c2410_rtc_alarmno = platform_get_irq(pdev, 0); |
457 | if (s3c2410_rtc_alarmno <= 0) { | 457 | if (s3c2410_rtc_alarmno < 0) { |
458 | dev_err(&pdev->dev, "no irq for alarm\n"); | 458 | dev_err(&pdev->dev, "no irq for alarm\n"); |
459 | return -ENOENT; | 459 | return -ENOENT; |
460 | } | 460 | } |
diff --git a/drivers/char/watchdog/mpcore_wdt.c b/drivers/char/watchdog/mpcore_wdt.c index b4d843489881..2c2c51773200 100644 --- a/drivers/char/watchdog/mpcore_wdt.c +++ b/drivers/char/watchdog/mpcore_wdt.c | |||
@@ -338,6 +338,10 @@ static int __devinit mpcore_wdt_probe(struct platform_device *dev) | |||
338 | 338 | ||
339 | wdt->dev = &dev->dev; | 339 | wdt->dev = &dev->dev; |
340 | wdt->irq = platform_get_irq(dev, 0); | 340 | wdt->irq = platform_get_irq(dev, 0); |
341 | if (wdt->irq < 0) { | ||
342 | ret = -ENXIO; | ||
343 | goto err_free; | ||
344 | } | ||
341 | wdt->base = ioremap(res->start, res->end - res->start + 1); | 345 | wdt->base = ioremap(res->start, res->end - res->start + 1); |
342 | if (!wdt->base) { | 346 | if (!wdt->base) { |
343 | ret = -ENOMEM; | 347 | ret = -ENOMEM; |
diff --git a/drivers/i2c/busses/i2c-iop3xx.c b/drivers/i2c/busses/i2c-iop3xx.c index 1414851a17b8..d00a02fc23e4 100644 --- a/drivers/i2c/busses/i2c-iop3xx.c +++ b/drivers/i2c/busses/i2c-iop3xx.c | |||
@@ -434,7 +434,7 @@ static int | |||
434 | iop3xx_i2c_probe(struct platform_device *pdev) | 434 | iop3xx_i2c_probe(struct platform_device *pdev) |
435 | { | 435 | { |
436 | struct resource *res; | 436 | struct resource *res; |
437 | int ret; | 437 | int ret, irq; |
438 | struct i2c_adapter *new_adapter; | 438 | struct i2c_adapter *new_adapter; |
439 | struct i2c_algo_iop3xx_data *adapter_data; | 439 | struct i2c_algo_iop3xx_data *adapter_data; |
440 | 440 | ||
@@ -470,7 +470,12 @@ iop3xx_i2c_probe(struct platform_device *pdev) | |||
470 | goto release_region; | 470 | goto release_region; |
471 | } | 471 | } |
472 | 472 | ||
473 | ret = request_irq(platform_get_irq(pdev, 0), iop3xx_i2c_irq_handler, 0, | 473 | irq = platform_get_irq(pdev, 0); |
474 | if (irq < 0) { | ||
475 | ret = -ENXIO; | ||
476 | goto unmap; | ||
477 | } | ||
478 | ret = request_irq(irq, iop3xx_i2c_irq_handler, 0, | ||
474 | pdev->name, adapter_data); | 479 | pdev->name, adapter_data); |
475 | 480 | ||
476 | if (ret) { | 481 | if (ret) { |
diff --git a/drivers/i2c/busses/i2c-mpc.c b/drivers/i2c/busses/i2c-mpc.c index 5ccd338a9dc9..2721e4c8184a 100644 --- a/drivers/i2c/busses/i2c-mpc.c +++ b/drivers/i2c/busses/i2c-mpc.c | |||
@@ -302,6 +302,10 @@ static int fsl_i2c_probe(struct platform_device *pdev) | |||
302 | } | 302 | } |
303 | 303 | ||
304 | i2c->irq = platform_get_irq(pdev, 0); | 304 | i2c->irq = platform_get_irq(pdev, 0); |
305 | if (i2c->irq < 0) { | ||
306 | result = -ENXIO; | ||
307 | goto fail_get_irq; | ||
308 | } | ||
305 | i2c->flags = pdata->device_flags; | 309 | i2c->flags = pdata->device_flags; |
306 | init_waitqueue_head(&i2c->queue); | 310 | init_waitqueue_head(&i2c->queue); |
307 | 311 | ||
@@ -340,6 +344,7 @@ static int fsl_i2c_probe(struct platform_device *pdev) | |||
340 | fail_irq: | 344 | fail_irq: |
341 | iounmap(i2c->base); | 345 | iounmap(i2c->base); |
342 | fail_map: | 346 | fail_map: |
347 | fail_get_irq: | ||
343 | kfree(i2c); | 348 | kfree(i2c); |
344 | return result; | 349 | return result; |
345 | }; | 350 | }; |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 22781d84f79f..ac5cde1bbd2b 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -516,6 +516,10 @@ mv64xxx_i2c_probe(struct platform_device *pd) | |||
516 | drv_data->freq_m = pdata->freq_m; | 516 | drv_data->freq_m = pdata->freq_m; |
517 | drv_data->freq_n = pdata->freq_n; | 517 | drv_data->freq_n = pdata->freq_n; |
518 | drv_data->irq = platform_get_irq(pd, 0); | 518 | drv_data->irq = platform_get_irq(pd, 0); |
519 | if (drv_data->irq < 0) { | ||
520 | rc = -ENXIO; | ||
521 | goto exit_unmap_regs; | ||
522 | } | ||
519 | drv_data->adapter.id = I2C_HW_MV64XXX; | 523 | drv_data->adapter.id = I2C_HW_MV64XXX; |
520 | drv_data->adapter.algo = &mv64xxx_i2c_algo; | 524 | drv_data->adapter.algo = &mv64xxx_i2c_algo; |
521 | drv_data->adapter.owner = THIS_MODULE; | 525 | drv_data->adapter.owner = THIS_MODULE; |
diff --git a/drivers/ide/mips/au1xxx-ide.c b/drivers/ide/mips/au1xxx-ide.c index 32431dcf5d8e..71f27e955d87 100644 --- a/drivers/ide/mips/au1xxx-ide.c +++ b/drivers/ide/mips/au1xxx-ide.c | |||
@@ -674,6 +674,11 @@ static int au_ide_probe(struct device *dev) | |||
674 | ret = -ENODEV; | 674 | ret = -ENODEV; |
675 | goto out; | 675 | goto out; |
676 | } | 676 | } |
677 | if (ahwif->irq < 0) { | ||
678 | pr_debug("%s %d: no IRQ\n", DRV_NAME, pdev->id); | ||
679 | ret = -ENODEV; | ||
680 | goto out; | ||
681 | } | ||
677 | 682 | ||
678 | if (!request_mem_region (res->start, res->end-res->start, pdev->name)) { | 683 | if (!request_mem_region (res->start, res->end-res->start, pdev->name)) { |
679 | pr_debug("%s: request_mem_region failed\n", DRV_NAME); | 684 | pr_debug("%s: request_mem_region failed\n", DRV_NAME); |
diff --git a/drivers/mmc/pxamci.c b/drivers/mmc/pxamci.c index 285d7d068097..c32fad1ce51c 100644 --- a/drivers/mmc/pxamci.c +++ b/drivers/mmc/pxamci.c | |||
@@ -438,7 +438,7 @@ static int pxamci_probe(struct platform_device *pdev) | |||
438 | 438 | ||
439 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 439 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
440 | irq = platform_get_irq(pdev, 0); | 440 | irq = platform_get_irq(pdev, 0); |
441 | if (!r || irq == NO_IRQ) | 441 | if (!r || irq < 0) |
442 | return -ENXIO; | 442 | return -ENXIO; |
443 | 443 | ||
444 | r = request_mem_region(r->start, SZ_4K, DRIVER_NAME); | 444 | r = request_mem_region(r->start, SZ_4K, DRIVER_NAME); |
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c index 53e3afc1b7b7..09d5c3f26985 100644 --- a/drivers/net/arm/am79c961a.c +++ b/drivers/net/arm/am79c961a.c | |||
@@ -696,7 +696,9 @@ static int __init am79c961_probe(struct platform_device *pdev) | |||
696 | dev->base_addr = res->start; | 696 | dev->base_addr = res->start; |
697 | dev->irq = platform_get_irq(pdev, 0); | 697 | dev->irq = platform_get_irq(pdev, 0); |
698 | 698 | ||
699 | ret = -ENODEV; | 699 | ret = -ENODEV; |
700 | if (dev->irq < 0) | ||
701 | goto nodev; | ||
700 | if (!request_region(dev->base_addr, 0x18, dev->name)) | 702 | if (!request_region(dev->base_addr, 0x18, dev->name)) |
701 | goto nodev; | 703 | goto nodev; |
702 | 704 | ||
diff --git a/drivers/net/fs_enet/mac-fcc.c b/drivers/net/fs_enet/mac-fcc.c index e67b1d06611c..95e2bb8dd7b4 100644 --- a/drivers/net/fs_enet/mac-fcc.c +++ b/drivers/net/fs_enet/mac-fcc.c | |||
@@ -118,6 +118,8 @@ static int do_pd_setup(struct fs_enet_private *fep) | |||
118 | 118 | ||
119 | /* Fill out IRQ field */ | 119 | /* Fill out IRQ field */ |
120 | fep->interrupt = platform_get_irq(pdev, 0); | 120 | fep->interrupt = platform_get_irq(pdev, 0); |
121 | if (fep->interrupt < 0) | ||
122 | return -EINVAL; | ||
121 | 123 | ||
122 | /* Attach the memory for the FCC Parameter RAM */ | 124 | /* Attach the memory for the FCC Parameter RAM */ |
123 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fcc_pram"); | 125 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "fcc_pram"); |
diff --git a/drivers/net/fs_enet/mac-fec.c b/drivers/net/fs_enet/mac-fec.c index 2e8f44469699..3dad69dfdb2c 100644 --- a/drivers/net/fs_enet/mac-fec.c +++ b/drivers/net/fs_enet/mac-fec.c | |||
@@ -144,6 +144,8 @@ static int do_pd_setup(struct fs_enet_private *fep) | |||
144 | 144 | ||
145 | /* Fill out IRQ field */ | 145 | /* Fill out IRQ field */ |
146 | fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); | 146 | fep->interrupt = platform_get_irq_byname(pdev,"interrupt"); |
147 | if (fep->interrupt < 0) | ||
148 | return -EINVAL; | ||
147 | 149 | ||
148 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); | 150 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); |
149 | fep->fec.fecp =(void*)r->start; | 151 | fep->fec.fecp =(void*)r->start; |
diff --git a/drivers/net/fs_enet/mac-scc.c b/drivers/net/fs_enet/mac-scc.c index a3897fda71fa..a772b286f96d 100644 --- a/drivers/net/fs_enet/mac-scc.c +++ b/drivers/net/fs_enet/mac-scc.c | |||
@@ -118,6 +118,8 @@ static int do_pd_setup(struct fs_enet_private *fep) | |||
118 | 118 | ||
119 | /* Fill out IRQ field */ | 119 | /* Fill out IRQ field */ |
120 | fep->interrupt = platform_get_irq_byname(pdev, "interrupt"); | 120 | fep->interrupt = platform_get_irq_byname(pdev, "interrupt"); |
121 | if (fep->interrupt < 0) | ||
122 | return -EINVAL; | ||
121 | 123 | ||
122 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); | 124 | r = platform_get_resource_byname(pdev, IORESOURCE_MEM, "regs"); |
123 | fep->scc.sccp = (void *)r->start; | 125 | fep->scc.sccp = (void *)r->start; |
diff --git a/drivers/net/gianfar.c b/drivers/net/gianfar.c index 0e8e3fcde9ff..771e25d8c417 100644 --- a/drivers/net/gianfar.c +++ b/drivers/net/gianfar.c | |||
@@ -193,8 +193,12 @@ static int gfar_probe(struct platform_device *pdev) | |||
193 | priv->interruptTransmit = platform_get_irq_byname(pdev, "tx"); | 193 | priv->interruptTransmit = platform_get_irq_byname(pdev, "tx"); |
194 | priv->interruptReceive = platform_get_irq_byname(pdev, "rx"); | 194 | priv->interruptReceive = platform_get_irq_byname(pdev, "rx"); |
195 | priv->interruptError = platform_get_irq_byname(pdev, "error"); | 195 | priv->interruptError = platform_get_irq_byname(pdev, "error"); |
196 | if (priv->interruptTransmit < 0 || priv->interruptReceive < 0 || priv->interruptError < 0) | ||
197 | goto regs_fail; | ||
196 | } else { | 198 | } else { |
197 | priv->interruptTransmit = platform_get_irq(pdev, 0); | 199 | priv->interruptTransmit = platform_get_irq(pdev, 0); |
200 | if (priv->interruptTransmit < 0) | ||
201 | goto regs_fail; | ||
198 | } | 202 | } |
199 | 203 | ||
200 | /* get a pointer to the register memory */ | 204 | /* get a pointer to the register memory */ |
diff --git a/drivers/net/smc91x.c b/drivers/net/smc91x.c index 7ec08127c9d6..75e9b3b910cc 100644 --- a/drivers/net/smc91x.c +++ b/drivers/net/smc91x.c | |||
@@ -2221,6 +2221,10 @@ static int smc_drv_probe(struct platform_device *pdev) | |||
2221 | 2221 | ||
2222 | ndev->dma = (unsigned char)-1; | 2222 | ndev->dma = (unsigned char)-1; |
2223 | ndev->irq = platform_get_irq(pdev, 0); | 2223 | ndev->irq = platform_get_irq(pdev, 0); |
2224 | if (ndev->irq < 0) { | ||
2225 | ret = -ENODEV; | ||
2226 | goto out_free_netdev; | ||
2227 | } | ||
2224 | 2228 | ||
2225 | ret = smc_request_attrib(pdev); | 2229 | ret = smc_request_attrib(pdev); |
2226 | if (ret) | 2230 | if (ret) |
diff --git a/drivers/pcmcia/omap_cf.c b/drivers/pcmcia/omap_cf.c index 47b5ade95bde..2c23d7584399 100644 --- a/drivers/pcmcia/omap_cf.c +++ b/drivers/pcmcia/omap_cf.c | |||
@@ -218,7 +218,7 @@ static int __init omap_cf_probe(struct device *dev) | |||
218 | 218 | ||
219 | /* either CFLASH.IREQ (INT_1610_CF) or some GPIO */ | 219 | /* either CFLASH.IREQ (INT_1610_CF) or some GPIO */ |
220 | irq = platform_get_irq(pdev, 0); | 220 | irq = platform_get_irq(pdev, 0); |
221 | if (!irq) | 221 | if (irq < 0) |
222 | return -EINVAL; | 222 | return -EINVAL; |
223 | 223 | ||
224 | cf = kcalloc(1, sizeof *cf, GFP_KERNEL); | 224 | cf = kcalloc(1, sizeof *cf, GFP_KERNEL); |
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c index 7410e093a6b9..00d7c0ad8cbf 100644 --- a/drivers/serial/s3c2410.c +++ b/drivers/serial/s3c2410.c | |||
@@ -1066,6 +1066,8 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport, | |||
1066 | port->mapbase = res->start; | 1066 | port->mapbase = res->start; |
1067 | port->membase = S3C24XX_VA_UART + (res->start - S3C24XX_PA_UART); | 1067 | port->membase = S3C24XX_VA_UART + (res->start - S3C24XX_PA_UART); |
1068 | port->irq = platform_get_irq(platdev, 0); | 1068 | port->irq = platform_get_irq(platdev, 0); |
1069 | if (port->irq < 0) | ||
1070 | port->irq = 0; | ||
1069 | 1071 | ||
1070 | ourport->clk = clk_get(&platdev->dev, "uart"); | 1072 | ourport->clk = clk_get(&platdev->dev, "uart"); |
1071 | 1073 | ||
diff --git a/drivers/usb/core/driver.c b/drivers/usb/core/driver.c index dce9d987f0fc..c196f3845305 100644 --- a/drivers/usb/core/driver.c +++ b/drivers/usb/core/driver.c | |||
@@ -378,7 +378,7 @@ const struct usb_device_id *usb_match_id(struct usb_interface *interface, | |||
378 | 378 | ||
379 | return NULL; | 379 | return NULL; |
380 | } | 380 | } |
381 | EXPORT_SYMBOL(usb_match_id); | 381 | EXPORT_SYMBOL_GPL_FUTURE(usb_match_id); |
382 | 382 | ||
383 | int usb_device_match(struct device *dev, struct device_driver *drv) | 383 | int usb_device_match(struct device *dev, struct device_driver *drv) |
384 | { | 384 | { |
@@ -446,7 +446,7 @@ int usb_register_driver(struct usb_driver *new_driver, struct module *owner) | |||
446 | 446 | ||
447 | return retval; | 447 | return retval; |
448 | } | 448 | } |
449 | EXPORT_SYMBOL(usb_register_driver); | 449 | EXPORT_SYMBOL_GPL_FUTURE(usb_register_driver); |
450 | 450 | ||
451 | /** | 451 | /** |
452 | * usb_deregister - unregister a USB driver | 452 | * usb_deregister - unregister a USB driver |
@@ -469,4 +469,4 @@ void usb_deregister(struct usb_driver *driver) | |||
469 | 469 | ||
470 | usbfs_update_special(); | 470 | usbfs_update_special(); |
471 | } | 471 | } |
472 | EXPORT_SYMBOL(usb_deregister); | 472 | EXPORT_SYMBOL_GPL_FUTURE(usb_deregister); |
diff --git a/drivers/usb/host/ohci-omap.c b/drivers/usb/host/ohci-omap.c index 3785b3f7df1b..ca19abe01c53 100644 --- a/drivers/usb/host/ohci-omap.c +++ b/drivers/usb/host/ohci-omap.c | |||
@@ -286,7 +286,7 @@ void usb_hcd_omap_remove (struct usb_hcd *, struct platform_device *); | |||
286 | int usb_hcd_omap_probe (const struct hc_driver *driver, | 286 | int usb_hcd_omap_probe (const struct hc_driver *driver, |
287 | struct platform_device *pdev) | 287 | struct platform_device *pdev) |
288 | { | 288 | { |
289 | int retval; | 289 | int retval, irq; |
290 | struct usb_hcd *hcd = 0; | 290 | struct usb_hcd *hcd = 0; |
291 | struct ohci_hcd *ohci; | 291 | struct ohci_hcd *ohci; |
292 | 292 | ||
@@ -329,7 +329,12 @@ int usb_hcd_omap_probe (const struct hc_driver *driver, | |||
329 | if (retval < 0) | 329 | if (retval < 0) |
330 | goto err2; | 330 | goto err2; |
331 | 331 | ||
332 | retval = usb_add_hcd(hcd, platform_get_irq(pdev, 0), SA_INTERRUPT); | 332 | irq = platform_get_irq(pdev, 0); |
333 | if (irq < 0) { | ||
334 | retval = -ENXIO; | ||
335 | goto err2; | ||
336 | } | ||
337 | retval = usb_add_hcd(hcd, irq, SA_INTERRUPT); | ||
333 | if (retval == 0) | 338 | if (retval == 0) |
334 | return retval; | 339 | return retval; |
335 | 340 | ||
diff --git a/drivers/video/epson1355fb.c b/drivers/video/epson1355fb.c index 3b0e71383448..082759447bf6 100644 --- a/drivers/video/epson1355fb.c +++ b/drivers/video/epson1355fb.c | |||
@@ -607,6 +607,7 @@ static void clearfb16(struct fb_info *info) | |||
607 | 607 | ||
608 | static void epson1355fb_platform_release(struct device *device) | 608 | static void epson1355fb_platform_release(struct device *device) |
609 | { | 609 | { |
610 | dev_err(device, "This driver is broken, please bug the authors so they will fix it.\n"); | ||
610 | } | 611 | } |
611 | 612 | ||
612 | static int epson1355fb_remove(struct platform_device *dev) | 613 | static int epson1355fb_remove(struct platform_device *dev) |
diff --git a/drivers/video/sa1100fb.c b/drivers/video/sa1100fb.c index 8a893ce7040d..d9831fd42341 100644 --- a/drivers/video/sa1100fb.c +++ b/drivers/video/sa1100fb.c | |||
@@ -1457,7 +1457,7 @@ static int __init sa1100fb_probe(struct platform_device *pdev) | |||
1457 | int ret, irq; | 1457 | int ret, irq; |
1458 | 1458 | ||
1459 | irq = platform_get_irq(pdev, 0); | 1459 | irq = platform_get_irq(pdev, 0); |
1460 | if (irq <= 0) | 1460 | if (irq < 0) |
1461 | return -EINVAL; | 1461 | return -EINVAL; |
1462 | 1462 | ||
1463 | if (!request_mem_region(0xb0100000, 0x10000, "LCD")) | 1463 | if (!request_mem_region(0xb0100000, 0x10000, "LCD")) |
diff --git a/drivers/video/vfb.c b/drivers/video/vfb.c index 53208cb58396..77eed1fd9943 100644 --- a/drivers/video/vfb.c +++ b/drivers/video/vfb.c | |||
@@ -401,6 +401,7 @@ static int __init vfb_setup(char *options) | |||
401 | static void vfb_platform_release(struct device *device) | 401 | static void vfb_platform_release(struct device *device) |
402 | { | 402 | { |
403 | // This is called when the reference count goes to zero. | 403 | // This is called when the reference count goes to zero. |
404 | dev_err(device, "This driver is broken, please bug the authors so they will fix it.\n"); | ||
404 | } | 405 | } |
405 | 406 | ||
406 | static int __init vfb_probe(struct platform_device *dev) | 407 | static int __init vfb_probe(struct platform_device *dev) |