Thread (4 messages) flat view 4 messages, 3 authors, 2012-05-24

Re: [PATCH v5] input: Add MELFAS mms114 touchscreen driver

From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Date: 2012-05-24 07:53:57

Hi Joonyoung,

On Thu, May 24, 2012 at 03:37:47PM +0900, Joonyoung Shim wrote:
+
+static int mms114_start(struct mms114_data *data)
+{
+	int error;
+
+	mutex_lock(&data->mutex);
+	if (data->enabled)
+		goto out;
This seems too complicated. You already take input_dev->mutex in
suspend/resume and open/close are called with this mutex held so you do
not need yet another mutex here.

Same goes for data->enabled - you can go by the fact that number of
users != 0.

It also looks like you want to bring enabling/disabling IRQ into
start/stop and probably cfg_pin as well.

Thanks.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help