Assert topology is held in g_dev_getprovider().

Don't call devsw().  It is not necessary, and we do not need to hold dev_lock
to compare the devsw pointer to our own since we do not dereference it.
This commit is contained in:
phk 2004-09-24 06:43:20 +00:00
parent 1a87f07f3c
commit 54ba36ef3e

View File

@ -99,11 +99,13 @@ g_dev_getprovider(struct cdev *dev)
{
struct g_consumer *cp;
g_topology_assert();
if (dev == NULL)
return (NULL);
if (devsw(dev) != &g_dev_cdevsw)
return (NULL);
cp = dev->si_drv2;
if (dev->si_devsw != &g_dev_cdevsw)
cp = NULL;
else
cp = dev->si_drv2;
return (cp->provider);
}