Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 3745
b: refs/heads/master
c: 23a83bf
h: refs/heads/master
i:
  3743: d756042
v: v3
  • Loading branch information
Dominik Brodowski authored and Linus Torvalds committed Jun 28, 2005
1 parent 49d2efd commit 20819dc
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 1ad275e3e7d253d44f03868e85977c908e334fed
refs/heads/master: 23a83bfe6ab51c745d109d979c78a96fe3e93f5c
37 changes: 37 additions & 0 deletions trunk/drivers/pcmcia/ds.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,6 +260,41 @@ void cs_error(client_handle_t handle, int func, int ret)
}
EXPORT_SYMBOL(cs_error);

#ifdef CONFIG_PCMCIA_DEBUG


static void pcmcia_check_driver(struct pcmcia_driver *p_drv)
{
struct pcmcia_device_id *did = p_drv->id_table;
unsigned int i;
u32 hash;

while (did && did->match_flags) {
for (i=0; i<4; i++) {
if (!did->prod_id[i])
continue;

hash = crc32(0, did->prod_id[i], strlen(did->prod_id[i]));
if (hash == did->prod_id_hash[i])
continue;

printk(KERN_DEBUG "pcmcia: %s: invalid hash for "
"product string \"%s\": is 0x%x, should "
"be 0x%x\n", p_drv->drv.name, did->prod_id[i],
did->prod_id_hash[i], hash);
}
did++;
}

return;
}

#else
static inline void pcmcia_check_driver(struct pcmcia_driver *p_drv) {
return;
}
#endif

/*======================================================================*/

static struct pcmcia_driver * get_pcmcia_driver (dev_info_t *dev_info);
Expand Down Expand Up @@ -296,6 +331,8 @@ int pcmcia_register_driver(struct pcmcia_driver *driver)
if (!driver)
return -EINVAL;

pcmcia_check_driver(driver);

/* initialize common fields */
driver->drv.bus = &pcmcia_bus_type;
driver->drv.owner = driver->owner;
Expand Down

0 comments on commit 20819dc

Please sign in to comment.