From: Tejun Heo <tj@kernel.org>
To: Grant Grundler <grundler@parisc-linux.org>
Cc: Greg KH <greg@kroah.com>,
Linux Kernel <linux-kernel@vger.kernel.org>,
linux-pci@vger.kernel.org, Shane Huang <Shane.Huang@amd.com>
Subject: Re: [PATCH] pci: separate out pci_add_dynid()
Date: Thu, 03 Sep 2009 07:43:28 +0900 [thread overview]
Message-ID: <4A9EF510.9080902@kernel.org> (raw)
In-Reply-To: <4A9EF402.7090800@kernel.org>
Ummm... another thought.
Tejun Heo wrote:
> It's one of the gripes I've had with the driver core interface.
> Returning the object which had its reference bumped up is nice to do
> do_something(get_driver(driver)); but it should have been made clear
> that the return value always equals the input parameter. IIRC, in the
> early days of the current driver model and kref, there were intentions
> to make kref somehow more capable and handle the last reference
> problem from within it so that if (get_driver(driver)) test is
> actually meaningful but that turned out to be not too feasible, so we
> ended up with unnecessary if () around driver model get functions. I
> try to remove them whenever an affected piece of code is being
> modified but there still are plenty left. I'll update comment on
> driver core get functions.
Greg, I think I suggested this before. What do you think about just
making those get functions return void? The current interface
combined with widespread if() around them is quite misleading. Most
device/driver structures are inherited and extended when actually in
use, so the driver or its subsystem code usually can't do much with
the return value other than checking for bogus error condition anyway.
Thanks.
--
tejun
next prev parent reply other threads:[~2009-09-02 22:43 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-02 9:20 [PATCH] pci: separate out pci_add_dynid() Tejun Heo
2009-09-02 9:22 ` [PATCH 2/2] pci-stub: add pci_stub.ids parameter Tejun Heo
2009-09-02 13:30 ` [PATCH] pci: separate out pci_add_dynid() Greg KH
2009-09-02 22:29 ` Tejun Heo
2009-09-02 16:10 ` Grant Grundler
2009-09-02 17:56 ` Greg KH
2009-09-02 22:38 ` Tejun Heo
2009-09-02 22:43 ` Tejun Heo [this message]
2009-09-03 0:05 ` Greg KH
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=4A9EF510.9080902@kernel.org \
--to=tj@kernel.org \
--cc=Shane.Huang@amd.com \
--cc=greg@kroah.com \
--cc=grundler@parisc-linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@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