Re: [PATCH] Onetouch - switch to using input_dev->dev.parent

Matthew Dharm <[email protected]>
Newsgroups gmane.linux.usb.devel
Organization One Eyed Alien Networks
Message-ID <[email protected]>
I won't pretend to know anything about the input subsystem.  But, from a
storage point of view, this looks fine.

Signed-off-by: Matthew Dharm <[email protected]>

Matt

On Tue, May 08, 2007 at 12:31:30AM -0400, Dmitry Torokhov wrote:
> In preparation for struct class_device -> struct device input
> core conversion, switch to using input_dev->dev.parent when
> specifying device position in sysfs tree.
> 
> Also, do not access input_dev->private directly, use helpers.
> 
> Signed-off-by: Dmitry Torokhov <[email protected]>
> ---
> 
>  drivers/usb/storage/onetouch.c |    9 +++++----
>  1 files changed, 5 insertions(+), 4 deletions(-)
> 
> Index: work/drivers/usb/storage/onetouch.c
> ===================================================================
> --- work.orig/drivers/usb/storage/onetouch.c
> +++ work/drivers/usb/storage/onetouch.c
> @@ -84,7 +84,7 @@ resubmit:
>  
>  static int usb_onetouch_open(struct input_dev *dev)
>  {
> -	struct usb_onetouch *onetouch = dev->private;
> +	struct usb_onetouch *onetouch = input_get_drvdata(dev);
>  
>  	onetouch->is_open = 1;
>  	onetouch->irq->dev = onetouch->udev;
> @@ -98,7 +98,7 @@ static int usb_onetouch_open(struct inpu
>  
>  static void usb_onetouch_close(struct input_dev *dev)
>  {
> -	struct usb_onetouch *onetouch = dev->private;
> +	struct usb_onetouch *onetouch = input_get_drvdata(dev);
>  
>  	usb_kill_urb(onetouch->irq);
>  	onetouch->is_open = 0;
> @@ -185,13 +185,14 @@ int onetouch_connect_input(struct us_dat
>  	input_dev->name = onetouch->name;
>  	input_dev->phys = onetouch->phys;
>  	usb_to_input_id(udev, &input_dev->id);
> -	input_dev->cdev.dev = &udev->dev;
> +	input_dev->dev.parent = &udev->dev;
>  
>  	set_bit(EV_KEY, input_dev->evbit);
>  	set_bit(ONETOUCH_BUTTON, input_dev->keybit);
>  	clear_bit(0, input_dev->keybit);
>  
> -	input_dev->private = onetouch;
> +	input_set_drvdata(input_dev, onetouch);
> +
>  	input_dev->open = usb_onetouch_open;
>  	input_dev->close = usb_onetouch_close;
>  

-- 
Matthew Dharm                              Home: [email protected] 
Maintainer, Linux USB Mass Storage Driver

P:  How about "Web Designer"?
DP: I'd like a name that people won't laugh at.
					-- Pitr and Dust Puppy
User Friendly, 12/6/1997

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

_______________________________________________
[email protected]
To unsubscribe, use the last form field at:
https://lists.sourceforge.net/lists/listinfo/linux-usb-devel
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (GNU/Linux)

iD8DBQFGQBfAHL9iwnUZqnkRAhxfAJ49oSbRxbcuKEkqJeOQoKPGMgacZwCgi2oh
5uwbdw6vWPMRLIFHbKPy0yE=
=Oqvi
-----END PGP SIGNATURE-----
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.