|
@@ -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;
|
|
|
}
|
|
|
|