/*
- * (C) Copyright 2007 Semihalf
+ * (C) Copyright 2007-2008 Semihalf
*
* Written by: Rafal Jaworowski <raj@semihalf.com>
*
int enum_started;
int enum_ended;
int type; /* "external" type: DT_STOR_{IDE,USB,etc} */
- char name[4];
+ char *name;
};
static struct stor_spec specs[ENUM_MAX] = { { 0, 0, 0, 0, "" }, };
if (first) {
di->cookie = (void *)get_dev(specs[type].name, 0);
- found = 1;
+ if (di->cookie == NULL)
+ return 0;
+ else
+ found = 1;
} else {
for (i = 0; i < specs[type].max_dev; i++)
}
di->cookie = (void *)get_dev(specs[type].name, i);
- found = 1;
+ if (di->cookie == NULL)
+ return 0;
+ else
+ found = 1;
/* provide hint if there are more devices in
* this group to enumerate */
return 0;
if ((dd->block_read) == NULL) {
- debugf("no block_read() for device 0x%08x\n");
+ debugf("no block_read() for device 0x%08x\n", cookie);
return 0;
}