From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: chris@cnpbagwell.com
Cc: linux-input@vger.kernel.org, dmitry.torokhov@gmail.com,
pinglinux@gmail.com
Subject: Re: [PATCH 1/5] Input: wacom - isolate input registration
Date: Mon, 06 Feb 2012 11:22:37 +0800 [thread overview]
Message-ID: <4F2F477D.3040507@cn.fujitsu.com> (raw)
In-Reply-To: <1328496376-28502-2-git-send-email-chris@cnpbagwell.com>
On 02/06/2012 10:46 AM, chris@cnpbagwell.com wrote:
> From: Chris Bagwell <chris@cnpbagwell.com>
>
> Although this better co-locates input registration logic,
> the main goal is to make it easier to optionally create
> input devices or delay creation to later time periods.
>
> Signed-off-by: Chris Bagwell <chris@cnpbagwell.com>
> ---
> drivers/input/tablet/wacom_sys.c | 53 +++++++++++++++++++++++--------------
> 1 files changed, 33 insertions(+), 20 deletions(-)
>
> diff --git a/drivers/input/tablet/wacom_sys.c b/drivers/input/tablet/wacom_sys.c
> index c9588ee..43e82e9 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -822,6 +822,37 @@ static void wacom_destroy_leds(struct wacom *wacom)
> }
> }
>
> +static int wacom_register_input(struct wacom *wacom)
> +{
> + struct input_dev *input_dev;
> + struct usb_interface *intf = wacom->intf;
> + struct usb_device *dev = interface_to_usbdev(intf);
> + struct wacom_wac *wacom_wac = &(wacom->wacom_wac);
> + int error;
> +
> + input_dev = input_allocate_device();
> + if (!input_dev)
> + return -ENOMEM;
> +
> + input_dev->name = wacom_wac->name;
> + input_dev->dev.parent = &intf->dev;
> + input_dev->open = wacom_open;
> + input_dev->close = wacom_close;
> + usb_to_input_id(dev, &input_dev->id);
> + input_set_drvdata(input_dev, wacom);
> +
> + wacom_wac->input = input_dev;
> + wacom_setup_input_capabilities(input_dev, wacom_wac);
> +
> + error = input_register_device(input_dev);
> + if (error) {
> + input_free_device(input_dev);
> + wacom_wac->input = 0;
^^^
spare space here. and better use NULL?
Thanks
-Wanlong Gao
next prev parent reply other threads:[~2012-02-06 4:00 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-02-06 2:46 [PATCH 0/5] Wacom Bamboo Wireless Support chris
2012-02-06 2:46 ` [PATCH 1/5] Input: wacom - isolate input registration chris
2012-02-06 3:22 ` Wanlong Gao [this message]
2012-02-06 14:46 ` Chris Bagwell
2012-02-06 2:46 ` [PATCH 2/5] Input: wacom - Bamboo wireless monitor framework chris
2012-02-06 16:00 ` Chris Bagwell
2012-02-06 2:46 ` [PATCH 3/5] Input: wacom - create inputs when wireless connect chris
2012-02-06 2:46 ` [PATCH 4/5] Input: wacom - wireless Bamboo battery status chris
2012-02-06 2:46 ` [PATCH 5/5] Input: wacom : Add missing LEDS_CLASS to Kconfig chris
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=4F2F477D.3040507@cn.fujitsu.com \
--to=gaowanlong@cn.fujitsu.com \
--cc=chris@cnpbagwell.com \
--cc=dmitry.torokhov@gmail.com \
--cc=linux-input@vger.kernel.org \
--cc=pinglinux@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.