Renamed probe() to register_device(), cleanup.
git-svn-id: file:///srv/svn/repos/haiku/trunk/current@10849 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -33,36 +33,29 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
pnp_notify_probe_by_module(device_node_info *node, const char *consumer_name)
|
pnp_notify_probe_by_module(device_node_info *node, const char *consumerName)
|
||||||
{
|
{
|
||||||
driver_module_info *consumer;
|
driver_module_info *consumer;
|
||||||
status_t res;
|
status_t status;
|
||||||
|
|
||||||
TRACE(("pnp_notify_probe_by_module(node %p, consumer: %s)\n", node, consumer_name));
|
TRACE(("pnp_notify_probe_by_module(node %p, consumer: %s)\n", node, consumerName));
|
||||||
|
|
||||||
res = get_module(consumer_name, (module_info **)&consumer);
|
status = get_module(consumerName, (module_info **)&consumer);
|
||||||
if (res < B_OK) {
|
if (status < B_OK) {
|
||||||
dprintf("Cannot load driver module %s (%s)\n", consumer_name, strerror(res));
|
dprintf("Cannot load driver module %s (%s)\n", consumerName, strerror(status));
|
||||||
goto exit;
|
return status;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (consumer->probe == NULL) {
|
if (consumer->register_device == NULL) {
|
||||||
dprintf("Driver %s has no probe hook\n", consumer_name);
|
dprintf("Driver %s has no register_device() hook\n", consumerName);
|
||||||
res = B_ERROR;
|
status = B_ERROR;
|
||||||
} else {
|
} else {
|
||||||
res = consumer->probe(node);
|
status = consumer->register_device(node);
|
||||||
TRACE(("Driver %s probe returned: %s\n", consumer_name, strerror(res)));
|
TRACE(("Driver %s register_device() returned: %s\n", consumerName, strerror(status)));
|
||||||
}
|
}
|
||||||
|
|
||||||
put_module(consumer_name);
|
put_module(consumerName);
|
||||||
|
return status;
|
||||||
exit:
|
|
||||||
#ifdef TRACE_NOTIFICATIONS
|
|
||||||
if (res != B_OK)
|
|
||||||
dprintf("notify_probe_by_module: %s\n", strerror(res));
|
|
||||||
#endif
|
|
||||||
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -94,7 +87,7 @@ notify_device_removed(device_node_info *node)
|
|||||||
// don't take node->loading into account - we want to know
|
// don't take node->loading into account - we want to know
|
||||||
// whether driver is loaded, not whether it is about to get loaded
|
// whether driver is loaded, not whether it is about to get loaded
|
||||||
loaded = node->load_count > 0;
|
loaded = node->load_count > 0;
|
||||||
|
|
||||||
if (loaded) {
|
if (loaded) {
|
||||||
TRACE(("Already loaded\n"));
|
TRACE(("Already loaded\n"));
|
||||||
driver = node->driver;
|
driver = node->driver;
|
||||||
|
|||||||
Reference in New Issue
Block a user