staticint compare_func(constchar *ida, constchar *idb)
{ int i;
/* we only need to compare the last 4 chars */ for (i = 3; i < 7; i++) { if (ida[i] != 'X' &&
idb[i] != 'X' && toupper(ida[i]) != toupper(idb[i])) return 0;
} return 1;
}
int compare_pnp_id(struct pnp_id *pos, constchar *id)
{ if (!pos || !id || (strlen(id) != 7)) return 0; if (memcmp(id, "ANYDEVS", 7) == 0) return 1; while (pos) { if (memcmp(pos->id, id, 3) == 0) if (compare_func(pos->id, id) == 1) return 1;
pos = pos->next;
} return 0;
}
if (pnp_drv->driver.pm && pnp_drv->driver.pm->suspend) {
error = pnp_drv->driver.pm->suspend(dev);
suspend_report_result(dev, pnp_drv->driver.pm->suspend, error); if (error) return error;
}
if (pnp_drv->suspend) {
error = pnp_drv->suspend(pnp_dev, state); if (error) return error;
}
/* can_write is necessary to be able to re-start the device on resume */ if (pnp_can_disable(pnp_dev) && pnp_can_write(pnp_dev)) {
error = pnp_stop_dev(pnp_dev); if (error) return error;
}
if (pnp_can_suspend(pnp_dev))
pnp_dev->protocol->suspend(pnp_dev, state); return 0;
}
/** * pnp_add_id - adds an EISA id to the specified device * @dev: pointer to the desired device * @id: pointer to an EISA id string
*/ struct pnp_id *pnp_add_id(struct pnp_dev *dev, constchar *id)
{ struct pnp_id *dev_id, *ptr;
dev_id = kzalloc(sizeof(struct pnp_id), GFP_KERNEL); if (!dev_id) return NULL;
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.