From: "Pekka Enberg" <penberg@cs.helsinki.fi>
To: Pau Oliva Fora <pau@eslack.org>
Cc: dmitry.torokhov@gmail.com, linux-input@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] Add support for HTC Shift Touchscreen
Date: Sat, 17 May 2008 16:02:15 +0300 [thread overview]
Message-ID: <84144f020805170602lc43b2f3g5088ef601481a926@mail.gmail.com> (raw)
In-Reply-To: <482ED31E.2000009@eslack.org>
Hi Pau,
On Sat, May 17, 2008 at 3:44 PM, Pau Oliva Fora <pau@eslack.org> wrote:
> @@ -0,0 +1,148 @@
> +/*
> + * HTC Shift touchscreen driver
> + *
> + * Copyright (C) 2008 Pau Oliva Fora <pof@eslack.org>
> + *
> + * Thanks to:
> + * Heikki Linnakangas - Penmount LPC touchscreen driver
> + * Wacom / Ping Cheng - Help on linuxwacom-devel
> + * Esteve Espuna - Ideas, tips, moral support :)
> + *
> + * Changelog:
> + * 29980517 v0.5 - code cleanup
> + * 29980517 v0.4 - initialization works (thanks esteve!)
> + * 20080514 v0.3 - works best with TouchKit egalax xorg driver
> + * 20080511 v0.2 - little hacks to make it more usable
> + * 20080510 v0.1 - works with evtouch driver
> + * 20080428 first non-working attempt
Please drop the changelog from your source file.
> +#define DRIVER_VERSION "v0.5"
> +#define DRIVER_DESC "HTC Shift touchscreen driver"
> +
> +MODULE_AUTHOR("Pau Oliva Fora <pau@eslack.org>");
> +MODULE_DESCRIPTION(DRIVER_DESC);
> +MODULE_LICENSE("GPL");
> +
> +#define HTCPEN_PORT0 0x068
> +#define HTCPEN_PORT1 0x06c
> +#define HTCPEN_PORT2 0x0250
> +#define HTCPEN_PORT3 0x0251
> +#define HTCPEN_IRQ 3
> +
> +static int inverse_y;
> +module_param(inverse_y, bool, 0644);
> +MODULE_PARM_DESC(inverse_y, "If set Y axe is inversed.");
> +
> +struct input_dev *htcpen_dev;
Why are you not using isa_register_driver() instead?
> +
> +static void poll_htcpen(void)
> +{
> +
Extra newline.
> + unsigned short x, y, xy;
> + unsigned short touch;
> +static int __init htcpen_init(void)
> +{
> +
Extra newline.
> + printk(KERN_INFO "htcpen: module inserted\n");
> +
> + inb_p(HTCPEN_PORT0);
So there's no way to probe the existence of this device?
> +
> + htcpen_dev = input_allocate_device();
> + if (!htcpen_dev) {
> + printk(KERN_ERR "htcpen: can't allocate device\n");
> + return -ENOMEM;
> + }
> +
> + if (request_irq(HTCPEN_IRQ, htcpen_interrupt, 0, "htcpen", NULL)) {
This is leaking htcpen_dev here. Look at some other drivers for
examples how to use gotos for this kind of error handling.
> + printk(KERN_ERR "htcpen: irq busy\n");
> + return -EBUSY;
> + }
> +
next prev parent reply other threads:[~2008-05-17 13:02 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-05-17 12:44 [PATCH] Add support for HTC Shift Touchscreen Pau Oliva Fora
2008-05-17 13:01 ` Sam Ravnborg
2008-05-17 13:02 ` Pekka Enberg [this message]
2008-05-17 16:38 ` Pau Oliva Fora
2008-05-18 9:26 ` Marcin Slusarz
2008-05-18 9:39 ` Pekka Enberg
2008-05-19 3:16 ` Pau Oliva Fora
2008-05-19 5:22 ` Pekka Enberg
2008-05-19 15:12 ` Pau Oliva Fora
2008-05-19 15:35 ` Dmitry Torokhov
2008-05-19 23:08 ` Pau Oliva Fora
2008-05-20 1:49 ` Dmitry Torokhov
2008-05-20 11:02 ` Pau Oliva Fora
2008-05-20 13:54 ` Dmitry Torokhov
2008-05-20 19:09 ` Pau Oliva Fora
2008-05-22 0:47 ` Pau Oliva Fora
2008-05-20 12:37 ` Andrey Panin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=84144f020805170602lc43b2f3g5088ef601481a926@mail.gmail.com \
--to=penberg@cs.helsinki.fi \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pau@eslack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).