All of lore.kernel.org
 help / color / mirror / Atom feed
From: greg@kroah.com (Greg KH)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Devres
Date: Fri, 21 Nov 2014 09:31:27 -0800	[thread overview]
Message-ID: <20141121173127.GA15760@kroah.com> (raw)
In-Reply-To: <CAENGNheuKaZYtE+5C7dtGuxSzgmjAJGGCUQyt74QE7mJdKa3-w@mail.gmail.com>

On Fri, Nov 21, 2014 at 03:21:57PM -0200, Raphael Philipe wrote:
> I have a device driver that requests a lot o memory regions with ioremap and
> request_mem_region.
> 
> Today I came across devres. I would like to known your oppinion regarding it?
> 
> If you don't know it, take a look here.?http://haifux.org/lectures/323/
> haifux-devres.pdf
> 
> It seems like a garbage collector for Linux Kernel. Do you agree?

"garbage collector" in what sense?

In the sense of "all of the things your device allocates will be
properly freed when your device is freed", then yes, that is true,
devres is great for that.

But as a "general" garbage collector, no, that's not what it is for, it
is a very specific tool for device-specific usages.

And yes, it's very good, everyone should be using it in their drivers.

greg k-h

      reply	other threads:[~2014-11-21 17:31 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-11-21 17:21 Devres Raphael Philipe
2014-11-21 17:31 ` Greg KH [this message]

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=20141121173127.GA15760@kroah.com \
    --to=greg@kroah.com \
    --cc=kernelnewbies@lists.kernelnewbies.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 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.