struct rw_semaphore lock_visor_dev; /* lock for dev */
struct input_dev *visorinput_dev;
bool paused;
- unsigned int opened;
unsigned int keycode_table_bytes; /* size of following array */
/* for keyboard devices: visorkbd_keycode[] + visorkbd_ext_keycode[] */
unsigned char keycode_table[0];
__func__, visorinput_dev);
return -EINVAL;
}
- devdata->opened++;
- dev_dbg(&visorinput_dev->dev, "%s opened %d\n", __func__,
- devdata->opened);
- if (devdata->opened == 1)
- visorbus_enable_channel_interrupts(devdata->dev);
+ dev_dbg(&visorinput_dev->dev, "%s opened\n", __func__);
+ visorbus_enable_channel_interrupts(devdata->dev);
return 0;
}
__func__, visorinput_dev);
return;
}
- if (devdata->opened) {
- devdata->opened--;
- dev_dbg(&visorinput_dev->dev, "%s closed %d\n", __func__,
- devdata->opened);
- if (devdata->opened == 0)
- visorbus_disable_channel_interrupts(devdata->dev);
- } else
- dev_err(&visorinput_dev->dev, "%s not open\n", __func__);
+ dev_dbg(&visorinput_dev->dev, "%s closed\n", __func__);
+ visorbus_disable_channel_interrupts(devdata->dev);
}
/*