All of lore.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Mark Brown <broonie@opensource.wolfsonmicro.com>
Cc: Wanlong Gao <wanlong.gao@gmail.com>, Greg KH <gregkh@suse.de>,
	Wanlong Gao <gaowanlong@cn.fujitsu.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH] drivers:input:set driver data to NULL for pcap_keys
Date: Mon, 25 Jul 2011 11:37:46 -0700	[thread overview]
Message-ID: <20110725183746.GD6876@core.coreip.homeip.net> (raw)
In-Reply-To: <20110725182928.GB1175@sirena.org.uk>

On Mon, Jul 25, 2011 at 07:29:28PM +0100, Mark Brown wrote:
> On Mon, Jul 25, 2011 at 11:19:16AM -0700, Dmitry Torokhov wrote:
> 
> > Right, like i2c bus we could just have platform core clean up platform
> > drvdata pointer after calling ->remove() and also if ->probe() errors
> > out.
> 
> I2C doesn't do this (at least not any more).
> 

Sure does. See drivers/i2c/i2c-core.c::i2c_device_probe() and
i2c_device_remove().

> > Then individual drivers do not have to care about cleaning up this
> > pointer.
> 
> They don't have to worry about it anyway, the only thing that is allowed
> to use the pointer is a currently bound driver and it's only allowed to
> rely on is that while it's bound it'll get back the same driver_data
> that it put in.

Right, except that some people trying to use this pointers to pass
platform data to the driver... Resetting the pointer to NULL on unbind
will hopefully show them their mistake.

-- 
Dmitry

  reply	other threads:[~2011-07-25 18:37 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-20 15:34 [PATCH] drivers:input:set driver data to NULL for pcap_keys Wanlong Gao
2011-07-25  8:30 ` Dmitry Torokhov
2011-07-25  9:14   ` Wanlong Gao
2011-07-25 15:21     ` Greg KH
2011-07-25 15:34       ` Wanlong Gao
2011-07-25 18:19         ` Dmitry Torokhov
2011-07-25 18:29           ` Mark Brown
2011-07-25 18:37             ` Dmitry Torokhov [this message]
2011-07-26  1:29               ` Wanlong Gao
2011-07-26  4:39                 ` Greg KH
2011-07-26  5:36                   ` Wanlong Gao
2011-07-26  6:02                     ` Greg KH
2011-07-26  6:25                       ` Wanlong Gao
2011-07-26  6:45                         ` Dmitry Torokhov
2011-07-26 16:41                           ` Greg KH
2011-07-26 17:26                             ` Dmitry Torokhov
2011-07-25 18:26       ` Mark Brown
2011-07-25 23:25         ` Greg KH
2011-07-26  8:54           ` Mark Brown

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=20110725183746.GD6876@core.coreip.homeip.net \
    --to=dmitry.torokhov@gmail.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=gaowanlong@cn.fujitsu.com \
    --cc=gregkh@suse.de \
    --cc=linux-input@vger.kernel.org \
    --cc=wanlong.gao@gmail.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.