/* Gets a reference to the ide_drive_t and increments the use count of the underlying LLDD module.  */
int ide_device_get(ide_drive_t *drive)
/* Gets a reference to the ide_drive_t and increments the use count of the underlying LLDD module.  */
int ide_device_get(ide_drive_t *drive)
{
	struct device *host_dev;
	struct module *module;
	if (!get_device(&drive->gendev))
		return -ENXIO;
	host_dev = drive->hwif->host->dev[0];
	module = host_dev ? host_dev->driver->owner : NULL;
	if (module && !try_module_get(module)) {
		put_device(&drive->gendev);
		return -ENXIO;
	}
	return 0;
}