All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Brownell <david-b@pacbell.net>
To: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Cc: Miguel Aguilar <miguel.aguilar@ridgerun.com>,
	nsnehaprabha@ti.com,
	davinci-linux-open-source@linux.davincidsp.com,
	linux-input@vger.kernel.org, todd.fischer@ridgerun.com,
	diego.dompe@ridgerun.com, clark.becker@ridgerun.com,
	santiago.nunez@ridgerun.com
Subject: Re: [PATCH 1/2] Input: DaVinci Keypad Driver
Date: Wed, 23 Sep 2009 10:51:05 -0700	[thread overview]
Message-ID: <200909231051.05714.david-b@pacbell.net> (raw)
In-Reply-To: <20090923163546.GA13435@core.coreip.homeip.net>

On Wednesday 23 September 2009, Dmitry Torokhov wrote:
> >> __devexit?
> > [MA] According to comments from David Brownell to the first version of 
> > this patch the __exit should be used.
> >
> > " - Use platform_driver_probe() and __exit/__exit_p();
> >    there's no point in keeping that code around in
> >    typical configs, it'd just waste memory. "
> 
> I am afraid David is wrong here.

No, you're just pointing out a bug introduced in some
unrelated code.  Such bugs happen when folk ignore the
code bloat issues.  (And didn't Linus recently point
out how such code bloat is becoming an issue?)


> Even when we register driver with 
> platform_driver_probe() we still have "unbind" attribute in sysfs which
> may be used to unbind the device from driver. If code is __exit then
> such attempts will cause oops.

That would be a bug in the unbind() code, which doesn't
currently recognize that not every driver or bus supports
hotplugging.  It should probably check for a null release()
pointer in the driver, and politely fail in that case.

That's just about the only place that a third party
(neither the driver nor its hotplug-aware bus framework)
will try to decouple device and driver ... and it's doing
it wrong.  So it's unlikely such bugs will be elsewhere.

It's *ALWAYS* been legit to have a NULL pointer in the
remove() methods.  That's why the __exit_p() -- or for
hotpluggable drivers, __devexit_p() -- macros exist:
for that particular case.

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

  parent reply	other threads:[~2009-09-23 17:51 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-09-22 21:27 [PATCH 1/2] Input: DaVinci Keypad Driver miguel.aguilar
2009-09-23  3:46 ` Dmitry Torokhov
2009-09-23 14:52   ` Miguel Aguilar
2009-09-23 16:35     ` Dmitry Torokhov
2009-09-23 17:07       ` Miguel Aguilar
2009-09-23 17:25         ` Miguel Aguilar
2009-09-23 17:41           ` Dmitry Torokhov
2009-09-23 18:15             ` Miguel Aguilar
2009-09-23 18:19               ` Dmitry Torokhov
2009-09-23 17:51       ` David Brownell [this message]
2009-09-23 18:07         ` Dmitry Torokhov
2009-09-23 19:29           ` David Brownell
2009-09-23 19:51             ` Dmitry Torokhov
2009-09-23 23:05               ` David Brownell
2009-09-24  5:40                 ` Dmitry Torokhov
2009-09-24 14:59   ` Miguel Aguilar
2009-09-24 16:21     ` Dmitry Torokhov

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=200909231051.05714.david-b@pacbell.net \
    --to=david-b@pacbell.net \
    --cc=clark.becker@ridgerun.com \
    --cc=davinci-linux-open-source@linux.davincidsp.com \
    --cc=diego.dompe@ridgerun.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=miguel.aguilar@ridgerun.com \
    --cc=nsnehaprabha@ti.com \
    --cc=santiago.nunez@ridgerun.com \
    --cc=todd.fischer@ridgerun.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.