[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20090903000506.GA31897@kroah.com>
Date: Wed, 2 Sep 2009 17:05:06 -0700
From: Greg KH <greg@...ah.com>
To: Tejun Heo <tj@...nel.org>
Cc: Grant Grundler <grundler@...isc-linux.org>,
Linux Kernel <linux-kernel@...r.kernel.org>,
linux-pci@...r.kernel.org, Shane Huang <Shane.Huang@....com>
Subject: Re: [PATCH] pci: separate out pci_add_dynid()
On Thu, Sep 03, 2009 at 07:43:28AM +0900, Tejun Heo wrote:
> 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?
I have no objection to that at all.
> The current interface combined with widespread if() around them is
> quite misleading.
I agree.
> 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.
I totally agree.
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists