Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751514AbVK3TbE (ORCPT ); Wed, 30 Nov 2005 14:31:04 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751517AbVK3TbE (ORCPT ); Wed, 30 Nov 2005 14:31:04 -0500 Received: from fri.itea.ntnu.no ([129.241.7.60]:26603 "EHLO fri.itea.ntnu.no") by vger.kernel.org with ESMTP id S1751514AbVK3TbC (ORCPT ); Wed, 30 Nov 2005 14:31:02 -0500 Subject: Re: [PATCH 2.6.14.2] Updated itmtouch kernel usb input driver (1/1) From: Hans-Christian Egtvedt To: LKML Cc: linux-input@atrey.karlin.mff.cuni.cz In-Reply-To: <200511232101.33783.dtor_core@ameritech.net> References: <1132764764.6394.14.camel@charlie.egtvedt.no> <20051123165813.GA3201@ucw.cz> <200511232101.33783.dtor_core@ameritech.net> Content-Type: multipart/mixed; boundary="=-5zDyK4G1G1mtaNuozK2Z" Organization: MIVU Solutions Date: Wed, 30 Nov 2005 20:31:00 +0100 Message-Id: <1133379060.5318.14.camel@charlie.egtvedt.no> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 X-Content-Scanned: with sophos and spamassassin at mailgw.ntnu.no. Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 9871 Lines: 175 --=-5zDyK4G1G1mtaNuozK2Z Content-Type: text/plain Content-Transfer-Encoding: 7bit On Wed, 2005-11-23 at 21:01 -0500, Dmitry Torokhov wrote: > On Wednesday 23 November 2005 11:58, Vojtech Pavlik wrote: > > > static int itmtouch_open(struct input_dev *input) > > > { > > > struct itmtouch_dev *itmtouch = input->private; > > > > > > + if (itmtouch->users++) > > > + return 0; > > > + > > Why are you adding this? input_open/close are serialized and called > only once when needed. I see I shiped my patch a bit hastly, this is dropped as discussed the very first time I submitted this driver (Mars I think). I had totally forgotten about this serializing. > > > itmtouch->readurb->dev = itmtouch->usbdev; > > > > > > if (usb_submit_urb(itmtouch->readurb, GFP_KERNEL)) > > > + { > > > + itmtouch->users--; > > > return -EIO; > > > + } > > > > > Brace should go on the same line with "if". Typo, corrected. > > > - usb_to_input_id(udev, &itmtouch->inputdev.id); > > > + itmtouch->inputdev.id.bustype = BUS_USB; > > > + itmtouch->inputdev.id.vendor = udev->descriptor.idVendor; > > > + itmtouch->inputdev.id.product = udev->descriptor.idProduct; > > > + itmtouch->inputdev.id.version = udev->descriptor.bcdDevice; > > > itmtouch->inputdev.dev = &intf->dev; > > Why are you replacing perfectly good code with incorrect one (endianess > issues)? This was already present but not syncronized with my local repository, corrected. > Plus you need to convert it to dynamic input_dev allocation for newer > kernels. This is new for me, I will look into it. I have also removed the nosync parameter since it was not welcome. I can't reproduce the double click fault with my LG L1510SF screen with the 2.6.14 kernel. So my guess is it is either a bug in some screens (I've changed mine just a couple of weeks ago) or an old bug in the kernel which has been solved. Thanks for the feedback. I've attached a patch to match all the comments. -- Hans-Christian Egtvedt MIVU Solutions --=-5zDyK4G1G1mtaNuozK2Z Content-Disposition: attachment; filename=itmtouch-1.3.2-linux-2.6.14.2.patch Content-Type: text/x-patch; name=itmtouch-1.3.2-linux-2.6.14.2.patch; charset=UTF-8 Content-Transfer-Encoding: base64 LS0tIC91c3Ivc3JjL2xpbnV4LTIuNi4xNC4yL2RyaXZlcnMvdXNiL2lucHV0L2l0bXRvdWNoLmMJ MjAwNS0xMS0yMyAxNjowMjo1NS4wMDAwMDAwMDAgKzAxMDANCisrKyBpdG10b3VjaC5jCTIwMDUt MTEtMzAgMjA6MTg6NDguMDAwMDAwMDAwICswMTAwDQpAQCAtMjIsMTUgKzIyLDMyIEBADQogICog ZHJpdmVyLiBDQyAtLSAyMDAzLzkvMjkNCiAgKg0KICAqIEhpc3RvcnkNCi0gKiAxLjAgJiAxLjEg MjAwMyAoQ0MpIHZvanRlY2hAc3VzZS5jeg0KLSAqICAgT3JpZ2luYWwgdmVyc2lvbiBmb3IgMi40 Lngga2VybmVscw0KKyAqIDEuMCAmIDEu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nZhbCk7DQorCXVzYl9maWxsX2ludF91cmIoaXRt dG91Y2gtPnJlYWR1cmIsDQorCQkJaXRtdG91Y2gtPnVzYmRldiwNCisJCQlwaXBlLA0KKwkJCWl0 bXRvdWNoLT5yYnVmLA0KKwkJCW1heHAsDQorCQkJaXRtdG91Y2hfaXJxLA0KKwkJCWl0bXRvdWNo LA0KKwkJCWVuZHBvaW50LT5iSW50ZXJ2YWwpOw0KIA0KIAlpbnB1dF9yZWdpc3Rlcl9kZXZpY2Uo Jml0bXRvdWNoLT5pbnB1dGRldik7DQogDQo= --=-5zDyK4G1G1mtaNuozK2Z-- - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/