Don't do the busy dance in icee_open/close
We don't need to do the busy dance for this driver. It's handled by destroy_dev() entirely. Since all we did was busy/unbusy in open/close, just delete them. We therefore don't need to track closes either. Reviewed by: ian@ Differential Revision: https://reviews.freebsd.org/D26431
This commit is contained in:
parent
45472826b9
commit
44a8153672
@ -113,17 +113,12 @@ static struct ofw_compat_data compat_data[] = {
|
||||
#define CDEV2SOFTC(dev) ((dev)->si_drv1)
|
||||
|
||||
/* cdev routines */
|
||||
static d_open_t icee_open;
|
||||
static d_close_t icee_close;
|
||||
static d_read_t icee_read;
|
||||
static d_write_t icee_write;
|
||||
|
||||
static struct cdevsw icee_cdevsw =
|
||||
{
|
||||
.d_version = D_VERSION,
|
||||
.d_flags = D_TRACKCLOSE,
|
||||
.d_open = icee_open,
|
||||
.d_close = icee_close,
|
||||
.d_read = icee_read,
|
||||
.d_write = icee_write
|
||||
};
|
||||
@ -230,28 +225,6 @@ icee_detach(device_t dev)
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
icee_open(struct cdev *dev, int oflags, int devtype, struct thread *td)
|
||||
{
|
||||
struct icee_softc *sc;
|
||||
|
||||
sc = CDEV2SOFTC(dev);
|
||||
if (device_get_state(sc->dev) < DS_BUSY)
|
||||
device_busy(sc->dev);
|
||||
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
icee_close(struct cdev *dev, int fflag, int devtype, struct thread *td)
|
||||
{
|
||||
struct icee_softc *sc;
|
||||
|
||||
sc = CDEV2SOFTC(dev);
|
||||
device_unbusy(sc->dev);
|
||||
return (0);
|
||||
}
|
||||
|
||||
static int
|
||||
icee_read(struct cdev *dev, struct uio *uio, int ioflag)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user