Skip to content
Snippets Groups Projects
Commit 765c9afc authored by Pekka Enberg's avatar Pekka Enberg
Browse files

devfs: device_destroy() API


Enable device_destroy() API for the virtio-rng driver.

Signed-off-by: default avatarPekka Enberg <penberg@cloudius-systems.com>
parent 989cf8ab
No related branches found
No related tags found
No related merge requests found
......@@ -213,23 +213,6 @@ device_create(struct driver *drv, const char *name, int flags)
return dev;
}
#if 0
int
device_destroy(struct device *dev)
{
sched_lock();
if (!device_valid(dev)) {
sched_unlock();
return ENODEV;
}
dev->active = 0;
device_release(dev);
sched_unlock();
return 0;
}
#endif
#if 0
/*
* Return device's private data.
......@@ -308,6 +291,21 @@ device_release(struct device *dev)
sched_unlock();
}
int
device_destroy(struct device *dev)
{
sched_lock();
if (!device_valid(dev)) {
sched_unlock();
return ENODEV;
}
dev->active = 0;
device_release(dev);
sched_unlock();
return 0;
}
/*
* device_open - open the specified device.
*
......
......@@ -204,6 +204,7 @@ void multiplex_strategy(struct bio *);
int physio(struct device *dev, struct uio *uio, int ioflags);
struct device * device_create(struct driver *drv, const char *name, int flags);
int device_destroy(struct device *dev);
void device_register(struct device *device, const char *name, int flags);
void read_partition_table(struct device *device);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment