linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sudip Mukherjee <sudipm.mukherjee@gmail.com>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Greg KH <gregkh@linuxfoundation.org>,
	linux-kernel@vger.kernel.org, linux-input@vger.kernel.org
Subject: Re: [PATCH] Input: drivers/joystick: use parallel port device model
Date: Wed, 5 Aug 2015 11:57:08 +0530	[thread overview]
Message-ID: <20150805062708.GE4958@sudip-pc> (raw)
In-Reply-To: <20150804184128.GC37185@dtor-ws>

On Tue, Aug 04, 2015 at 11:41:28AM -0700, Dmitry Torokhov wrote:
> On Mon, Aug 03, 2015 at 08:32:20PM +0530, Sudip Mukherjee wrote:
> > On Fri, Jul 31, 2015 at 01:43:06PM -0700, Dmitry Torokhov wrote:
> > > > 
> > > > Converting to the "new" api is the end goal here, no need to keep the
> > > > old one around anymore.
> > > 
> > > OK, then I guess we can do the conversion right (dropping db9_base
> > > module-global) and see if anyone screams at us.
> > Hi Dmitry,
<snip>	
> > NULL, but the code will get unnecessary complicated. And these are not
> > just hypothetical situtation I got them while testing.
> > I am ready to make the changes, just want your confirmation if it is
> > worth complicatng the code and taking risk just for removing one global
> > variable.
> 
> Hmm, it is quite unexpected that detach() is called even if attach() did
> not actually attach anything.
But that is the way original parallel port used to work. And this adding
the device model code was mainly done keeping the original behaviour of
the code. In the original code the register_driver did:
list_for_each_entry(port, &portlist, list)
	drv->attach(port);
list_add(&drv->list, &drivers);

And the unregister_driver did:
list_for_each_entry(port, &portlist, list)
	drv->detach(port);

So, the original code never checked if attach succeded or not, and used
to call detach whenever driver used to unregister even if attach failed.
It was on the driver to check for and maintain the status.

> Maybe it is not too late if attach() would return a pointer to:
But that will change the way the parallel port client drivers used to
work. Maybe, for now we should stick to the old existing behaviour until
all the conversion is complete (hopefully without any regression). And
after we have fully converted to device model then we can plan to improve
it.

regards
sudip

      reply	other threads:[~2015-08-05  6:27 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-30 14:06 [PATCH] Input: drivers/joystick: use parallel port device model Sudip Mukherjee
2015-07-30 16:53 ` Dmitry Torokhov
2015-07-31 10:15   ` Sudip Mukherjee
2015-07-31 16:54     ` Dmitry Torokhov
2015-07-31 17:34       ` Sudip Mukherjee
2015-07-31 20:36         ` Greg KH
2015-07-31 20:43           ` Dmitry Torokhov
2015-08-01 12:43             ` Sudip Mukherjee
2015-08-03 12:26               ` Pali Rohár
2015-08-03 12:36                 ` Sudip Mukherjee
2015-08-03 12:41                   ` Pali Rohár
2015-08-04 18:37                     ` Pali Rohár
2015-08-03 15:02             ` Sudip Mukherjee
2015-08-04 18:41               ` Dmitry Torokhov
2015-08-05  6:27                 ` Sudip Mukherjee [this message]

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=20150805062708.GE4958@sudip-pc \
    --to=sudipm.mukherjee@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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).