Linux Input Archive on lore.kernel.org
 help / color / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Bastian Blank <waldi@debian.org>
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Ping Cheng <pingc@wacom.com>
Subject: Re: [PATCH 2/7] Input: wacom - Get features from driver info
Date: Thu, 7 Jan 2010 11:06:30 -0800
Message-ID: <201001071106.31688.dmitry.torokhov@gmail.com> (raw)
In-Reply-To: <20100107182936.GA12913@wavehammer.waldi.eu.org>

On Thursday 07 January 2010 10:29:36 am Bastian Blank wrote:
> Get the features information from the driver info of the usb device id
> structure provided by the caller.  The device ids and feature structs
> are strong coupled using indices.
> 
> Signed-off-by: Bastian Blank <waldi@debian.org>
> ---
>  drivers/input/tablet/wacom_sys.c |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/input/tablet/wacom_sys.c
>  b/drivers/input/tablet/wacom_sys.c index ab42c25..b0f3fc3 100644
> --- a/drivers/input/tablet/wacom_sys.c
> +++ b/drivers/input/tablet/wacom_sys.c
> @@ -532,7 +532,7 @@ static int wacom_probe(struct usb_interface *intf,
>  const struct usb_device_id *i struct usb_endpoint_descriptor *endpoint;
>  	struct wacom *wacom;
>  	struct wacom_wac *wacom_wac;
> -	struct wacom_features *features;
> +	struct wacom_features *features = (void *)id->driver_info;

What is this cast for?

>  	struct input_dev *input_dev;
>  	int error = -ENOMEM;
> 
> @@ -557,7 +557,9 @@ static int wacom_probe(struct usb_interface *intf,
>  const struct usb_device_id *i usb_make_path(dev, wacom->phys,
>  sizeof(wacom->phys));
>  	strlcat(wacom->phys, "/input0", sizeof(wacom->phys));
> 
> -	wacom_wac->features = features = get_wacom_feature(id);
> +	if (!features)
> +		features = get_wacom_feature(id);

In which cases driver would not have driver_info set up?

> +	wacom_wac->features = features;
>  	BUG_ON(features->pktlen > WACOM_PKGLEN_MAX);
> 
>  	input_dev->name = wacom_wac->features->name;
> 

-- 
Dmitry

  reply index

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-01-07 18:25 [PATCH 0/7] Input: wacom - Setup features via " Bastian Blank
2010-01-07 18:29 ` [PATCH 1/7] Input: wacom - Move device ids to the initialisation Bastian Blank
2010-01-07 18:29 ` [PATCH 2/7] Input: wacom - Get features from driver info Bastian Blank
2010-01-07 19:06   ` Dmitry Torokhov [this message]
2010-01-07 19:21     ` Bastian Blank
2010-01-07 19:39       ` Dmitry Torokhov
2010-01-07 18:29 ` [PATCH 3/7] Input: wacom - Set driver info for Wacom Penpartner Bastian Blank
2010-01-07 18:29 ` [PATCH 4/7] Input: wacom - Convert remaining ids, part one Bastian Blank
2010-01-07 18:29 ` [PATCH 5/7] Input: wacom - Convert remaining ids, part two Bastian Blank
2010-01-11 21:22   ` Ping Cheng
2010-01-11 22:24     ` Bastian Blank
2010-02-03  8:47       ` Dmitry Torokhov
     [not found]         ` <bc07448c1002030634m2c8492a4h9dc1c1ad005bc98f@mail.gmail.com>
2010-02-03 17:28           ` Dmitry Torokhov
2010-01-07 18:30 ` [PATCH 6/7] Imput: wacom - Remove old feature struct setup Bastian Blank
2010-01-07 18:30 ` [PATCH 7/7] Input: wacom - Fail on missing features Bastian Blank
2010-01-07 19:08   ` Dmitry Torokhov
2010-01-07 19:21     ` Bastian Blank

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=201001071106.31688.dmitry.torokhov@gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pingc@wacom.com \
    --cc=waldi@debian.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

Linux Input Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-input/0 linux-input/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-input linux-input/ https://lore.kernel.org/linux-input \
		linux-input@vger.kernel.org
	public-inbox-index linux-input

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-input


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git