All of lore.kernel.org
 help / color / mirror / Atom feed
From: Wanlong Gao <gaowanlong@cn.fujitsu.com>
To: Greg KH <gregkh@suse.de>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Wanlong Gao <wanlong.gao@gmail.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH] drivers:input:set driver data to NULL for pcap_keys
Date: Tue, 26 Jul 2011 13:36:00 +0800	[thread overview]
Message-ID: <4E2E5240.4060309@cn.fujitsu.com> (raw)
In-Reply-To: <20110726043949.GA27720@suse.de>

On 07/26/2011 12:39 PM, Greg KH wrote:

>> +
>> +	if (drv->remove) {
>> +		dev_dbg(_dev, "remove\n");
>> +		status = drv->remove(dev);
>> +	} else {
>> +		status = 0;
>> +	}
>
> Again, why would remove ever be NULL?
>
> This whole thing isn't needed at all.
>
> greg k-h
Yeah, I see.

But Greg, why does i2c-core do this?
like:drivers/i2c/i2c-core.c:
static int i2c_device_remove(struct device *dev)
{
	struct i2c_client	*client = i2c_verify_client(dev);
	struct i2c_driver	*driver;
	int			status;

	if (!client || !dev->driver)
		return 0;

	driver = to_i2c_driver(dev->driver);
	if (driver->remove) {
		dev_dbg(dev, "remove\n");
		status = driver->remove(client);
	} else {
		dev->driver = NULL;
		status = 0;
	}
	if (status == 0) {
		client->driver = NULL;
		i2c_set_clientdata(client, NULL);
	}
	return status;
}

And now, I'm in a fog, can you clear me/us ?

-- 
Thanks
Best Regards
Wanlong Gao

  reply	other threads:[~2011-07-26  5: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
2011-07-26  1:29               ` Wanlong Gao
2011-07-26  4:39                 ` Greg KH
2011-07-26  5:36                   ` Wanlong Gao [this message]
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=4E2E5240.4060309@cn.fujitsu.com \
    --to=gaowanlong@cn.fujitsu.com \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=dmitry.torokhov@gmail.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.