linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
To: Oliver Neukum <oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
Cc: Alan Stern
	<stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.org>,
	linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Daniel Ritz <daniel.ritz-OI3hZJvNYWs@public.gmane.org>
Subject: Re: [PATCH 2/3] usbtouchscreen: Implement runtime power management
Date: Tue, 8 Jun 2010 01:37:51 -0700	[thread overview]
Message-ID: <20100608083751.GA27348@core.coreip.homeip.net> (raw)
In-Reply-To: <201006072247.33068.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>

On Mon, Jun 07, 2010 at 10:47:33PM +0200, Oliver Neukum wrote:
> Am Montag, 7. Juni 2010 22:22:54 schrieb Alan Stern:
> > On Mon, 7 Jun 2010, Oliver Neukum wrote:
> > 
> > > Am Montag, 7. Juni 2010 18:23:16 schrieb Dmitry Torokhov:
> > > > On Mon, Jun 07, 2010 at 03:13:42PM +0200, Oliver Neukum wrote:
> > > > >  static int usbtouch_open(struct input_dev *input)
> > > > >  {
> > > > >  	struct usbtouch_usb *usbtouch = input_get_drvdata(input);
> > > > > +	int r;
> > > > >  
> > > > >  	usbtouch->irq->dev = interface_to_usbdev(usbtouch->interface);
> > > > >  
> > > > > +	r = usb_autopm_get_interface(usbtouch->interface) ? -EIO : 0;
> > > > 
> > > > Why are we clobbering error code with -EIO? We should propagate te code
> > > > returned to us (here and below).
> > > 
> > > usb_autopm_get_interface() uses internal USB error codes which with
> > > a few exceptions, do not have the meaning error codes in user space
> > > have.
> > 
> > But other drivers don't do this.  What's special about usbtouch?
> 
> Then I'd say the other drivers are wrong. We cannot leak USB specific
> codes. Maybe we should pass -ENOMEM and -ENODEV, but the others
> really don't mean anything as generic codes.
> 

No, I'd say that usb_autopm_get_interface() is wrong - since it is
supposed to be used by drivers who are not concerned about USB-specific
codes these functions should not leak them to the callers but rather
provide ones suitable for reporting upstream.

Thanks.

-- 
Dmitry
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2010-06-08  8:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-07 13:13 [PATCH 2/3] usbtouchscreen: Implement runtime power management Oliver Neukum
2010-06-07 16:23 ` Dmitry Torokhov
     [not found]   ` <20100607162316.GB7706-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2010-06-07 19:31     ` Oliver Neukum
     [not found]       ` <201006072131.18949.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2010-06-07 20:22         ` Alan Stern
     [not found]           ` <Pine.LNX.4.44L0.1006071622260.1332-100000-IYeN2dnnYyZXsRXLowluHWD2FQJk+8+b@public.gmane.org>
2010-06-07 20:47             ` Oliver Neukum
     [not found]               ` <201006072247.33068.oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org>
2010-06-08  8:37                 ` Dmitry Torokhov [this message]
2010-06-08 10:14                   ` Oliver Neukum
     [not found]                   ` <20100608083751.GA27348-WlK9ik9hQGAhIp7JRqBPierSzoNAToWh@public.gmane.org>
2010-06-08 14:12                     ` Oliver Neukum
  -- strict thread matches above, loose matches on Subject: below --
2010-07-15 13:56 Oliver Neukum

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=20100608083751.GA27348@core.coreip.homeip.net \
    --to=dmitry.torokhov-re5jqeeqqe8avxtiumwx3w@public.gmane.org \
    --cc=daniel.ritz-OI3hZJvNYWs@public.gmane.org \
    --cc=linux-input-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=oliver-GvhC2dPhHPQdnm+yROfE0A@public.gmane.org \
    --cc=stern-nwvwT67g6+6dFdvTe/nMLpVzexx5G7lz@public.gmane.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).