diff options
Diffstat (limited to 'drivers/staging/crystalhd/crystalhd_lnx.c')
-rw-r--r-- | drivers/staging/crystalhd/crystalhd_lnx.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/staging/crystalhd/crystalhd_lnx.c b/drivers/staging/crystalhd/crystalhd_lnx.c index 60839690bee..fbb80f09a3d 100644 --- a/drivers/staging/crystalhd/crystalhd_lnx.c +++ b/drivers/staging/crystalhd/crystalhd_lnx.c @@ -15,11 +15,12 @@ along with this driver. If not, see <http://www.gnu.org/licenses/>. ***************************************************************************/ -#include <linux/smp_lock.h> +#include <linux/mutex.h> #include <linux/slab.h> #include "crystalhd_lnx.h" +static DEFINE_MUTEX(chd_dec_mutex); static struct class *crystalhd_class; static struct crystalhd_adp *g_adp_info; @@ -277,16 +278,16 @@ static long chd_dec_ioctl(struct file *fd, unsigned int cmd, unsigned long ua) return -ENODATA; } - lock_kernel(); + mutex_lock(&chd_dec_mutex); cproc = crystalhd_get_cmd_proc(&adp->cmds, cmd, uc); if (!cproc) { BCMLOG_ERR("Unhandled command: %d\n", cmd); - unlock_kernel(); + mutex_unlock(&chd_dec_mutex); return -EINVAL; } ret = chd_dec_api_cmd(adp, ua, uc->uid, cmd, cproc); - unlock_kernel(); + mutex_unlock(&chd_dec_mutex); return ret; } |