public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Robert Love <rml@novell.com>
Cc: Greg KH <greg@kroah.com>, Mr Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [patch] hdaps driver update.
Date: Wed, 14 Sep 2005 12:14:55 -0500	[thread overview]
Message-ID: <d120d500050914101436201a71@mail.gmail.com> (raw)
In-Reply-To: <1126715517.5738.35.camel@molly>

On 9/14/05, Robert Love <rml@novell.com> wrote:
> On Wed, 2005-09-14 at 09:16 -0700, Greg KH wrote:
> 
> > But you are reference counting a static object, right?  Which
> > isn't the nicest thing to have done.
> 
> I would not say it is not "the nicest thing", it is just not necessary
> to do the reference counting.  But we want the ref counting for other
> reasons, so it seems sensible.
> 
> > Why not just dynamically create it?
> 
> Seems silly to dynamically create something that we know a priori we
> only have one of.  E.g., why dynamically create something that is not
> dynamic.
> 
> But it is not a big deal.  If this is some rule of yours, I can
> kmalloc() the device_driver structure and kfree() it in my release()
> function.  Is that what you want?
> 

Just use platform_device_register_simple, it will allocate a platform
device for you and it has a release function.

> > No, if you have that .owner field in your driver, you get a symlink in
> > sysfs that points from your driver to the module that controls it.  You
> > just removed that symlink, which is not what I think you wanted to have
> > happen :(
> 
> But device release == module unload.
> 

For now. But I could see one changing device structure to create some
attribute that could keep the object pinned in memory even after
module is unloaded. It seems that we have settled on the rule that
driver_unregister waits for the last refrence to drop off but devices
can live longer.

-- 
Dmitry

  reply	other threads:[~2005-09-14 17:14 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-09-14 15:57 [patch] hdaps driver update Robert Love
2005-09-14 16:05 ` Greg KH
2005-09-14 16:09   ` Robert Love
2005-09-14 16:16     ` Greg KH
2005-09-14 16:31       ` Robert Love
2005-09-14 17:14         ` Dmitry Torokhov [this message]
2005-09-14 17:55           ` Robert Love
2005-09-14 17:38         ` Greg KH
2005-09-14 17:28       ` Dmitry Torokhov
2005-09-14 17:39         ` Greg KH
2005-09-14 18:19 ` [patch] hdaps driver update, updated Robert Love

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=d120d500050914101436201a71@mail.gmail.com \
    --to=dmitry.torokhov@gmail.com \
    --cc=akpm@osdl.org \
    --cc=dtor_core@ameritech.net \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rml@novell.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox