git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Fedora kernel-2.6.17-1.2142_FC4 patched with stable patch-2.6.17.4-vs2.0.2-rc26.diff
[linux-2.6.git]
/
drivers
/
pnp
/
pnpbios
/
rsparser.c
diff --git
a/drivers/pnp/pnpbios/rsparser.c
b/drivers/pnp/pnpbios/rsparser.c
index
7aafbf8
..
c89c98a
100644
(file)
--- a/
drivers/pnp/pnpbios/rsparser.c
+++ b/
drivers/pnp/pnpbios/rsparser.c
@@
-7,6
+7,14
@@
#include <linux/ctype.h>
#include <linux/pnp.h>
#include <linux/pnpbios.h>
#include <linux/ctype.h>
#include <linux/pnp.h>
#include <linux/pnpbios.h>
+#include <linux/string.h>
+#include <linux/slab.h>
+
+#ifdef CONFIG_PCI
+#include <linux/pci.h>
+#else
+inline void pcibios_penalize_isa_irq(int irq, int active) {}
+#endif /* CONFIG_PCI */
#include "pnpbios.h"
#include "pnpbios.h"
@@
-58,6
+66,7
@@
pnpbios_parse_allocated_irqresource(struct pnp_resource_table * res, int irq)
}
res->irq_resource[i].start =
res->irq_resource[i].end = (unsigned long) irq;
}
res->irq_resource[i].start =
res->irq_resource[i].end = (unsigned long) irq;
+ pcibios_penalize_isa_irq(irq, 1);
}
}
}
}
@@
-65,7
+74,9
@@
static void
pnpbios_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma)
{
int i = 0;
pnpbios_parse_allocated_dmaresource(struct pnp_resource_table * res, int dma)
{
int i = 0;
- while (!(res->dma_resource[i].flags & IORESOURCE_UNSET) && i < PNP_MAX_DMA) i++;
+ while (i < PNP_MAX_DMA &&
+ !(res->dma_resource[i].flags & IORESOURCE_UNSET))
+ i++;
if (i < PNP_MAX_DMA) {
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
if (dma == -1) {
if (i < PNP_MAX_DMA) {
res->dma_resource[i].flags = IORESOURCE_DMA; // Also clears _UNSET flag
if (dma == -1) {
@@
-238,7
+249,7
@@
static void
pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_mem * mem;
pnpbios_parse_mem_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_mem * mem;
- mem =
pnpbios_kmalloc(
sizeof(struct pnp_mem), GFP_KERNEL);
+ mem =
kcalloc(1,
sizeof(struct pnp_mem), GFP_KERNEL);
if (!mem)
return;
mem->min = ((p[5] << 8) | p[4]) << 8;
if (!mem)
return;
mem->min = ((p[5] << 8) | p[4]) << 8;
@@
-254,7
+265,7
@@
static void
pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_mem * mem;
pnpbios_parse_mem32_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_mem * mem;
- mem =
pnpbios_kmalloc(
sizeof(struct pnp_mem), GFP_KERNEL);
+ mem =
kcalloc(1,
sizeof(struct pnp_mem), GFP_KERNEL);
if (!mem)
return;
mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
if (!mem)
return;
mem->min = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
@@
-270,7
+281,7
@@
static void
pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_mem * mem;
pnpbios_parse_fixed_mem32_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_mem * mem;
- mem =
pnpbios_kmalloc(
sizeof(struct pnp_mem), GFP_KERNEL);
+ mem =
kcalloc(1,
sizeof(struct pnp_mem), GFP_KERNEL);
if (!mem)
return;
mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
if (!mem)
return;
mem->min = mem->max = (p[7] << 24) | (p[6] << 16) | (p[5] << 8) | p[4];
@@
-285,10
+296,13
@@
static void
pnpbios_parse_irq_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_irq * irq;
pnpbios_parse_irq_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_irq * irq;
- irq = pnpbios_kmalloc(sizeof(struct pnp_irq), GFP_KERNEL);
+ unsigned long bits;
+
+ irq = kcalloc(1, sizeof(struct pnp_irq), GFP_KERNEL);
if (!irq)
return;
if (!irq)
return;
- irq->map = (p[2] << 8) | p[1];
+ bits = (p[2] << 8) | p[1];
+ bitmap_copy(irq->map, &bits, 16);
if (size > 2)
irq->flags = p[3];
else
if (size > 2)
irq->flags = p[3];
else
@@
-301,7
+315,7
@@
static void
pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_dma * dma;
pnpbios_parse_dma_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_dma * dma;
- dma =
pnpbios_kmalloc(
sizeof(struct pnp_dma), GFP_KERNEL);
+ dma =
kcalloc(1,
sizeof(struct pnp_dma), GFP_KERNEL);
if (!dma)
return;
dma->map = p[1];
if (!dma)
return;
dma->map = p[1];
@@
-314,7
+328,7
@@
static void
pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_port * port;
pnpbios_parse_port_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_port * port;
- port =
pnpbios_kmalloc(
sizeof(struct pnp_port), GFP_KERNEL);
+ port =
kcalloc(1,
sizeof(struct pnp_port), GFP_KERNEL);
if (!port)
return;
port->min = (p[3] << 8) | p[2];
if (!port)
return;
port->min = (p[3] << 8) | p[2];
@@
-330,7
+344,7
@@
static void
pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_port * port;
pnpbios_parse_fixed_port_option(unsigned char *p, int size, struct pnp_option *option)
{
struct pnp_port * port;
- port =
pnpbios_kmalloc(
sizeof(struct pnp_port), GFP_KERNEL);
+ port =
kcalloc(1,
sizeof(struct pnp_port), GFP_KERNEL);
if (!port)
return;
port->min = port->max = (p[2] << 8) | p[1];
if (!port)
return;
port->min = port->max = (p[2] << 8) | p[1];
@@
-434,11
+448,7
@@
pnpbios_parse_resource_option_data(unsigned char * p, unsigned char * end, struc
break;
case SMALL_TAG_END:
break;
case SMALL_TAG_END:
- if (option_independent != option)
- printk(KERN_WARNING "PnPBIOS: Missing SMALL_TAG_ENDDEP tag\n");
- p = p + 2;
- return (unsigned char *)p;
- break;
+ return p + 2;
default: /* an unkown tag */
len_err:
default: /* an unkown tag */
len_err:
@@
-518,7
+528,7
@@
pnpbios_parse_compatible_ids(unsigned char *p, unsigned char *end, struct pnp_de
case SMALL_TAG_COMPATDEVID: /* compatible ID */
if (len != 4)
goto len_err;
case SMALL_TAG_COMPATDEVID: /* compatible ID */
if (len != 4)
goto len_err;
- dev_id =
pnpbios_kmalloc(
sizeof (struct pnp_id), GFP_KERNEL);
+ dev_id =
kcalloc(1,
sizeof (struct pnp_id), GFP_KERNEL);
if (!dev_id)
return NULL;
memset(dev_id, 0, sizeof(struct pnp_id));
if (!dev_id)
return NULL;
memset(dev_id, 0, sizeof(struct pnp_id));