From mboxrd@z Thu Jan 1 00:00:00 1970 From: greg@kroah.com (Greg KH) Date: Fri, 21 Nov 2014 09:31:27 -0800 Subject: Devres In-Reply-To: References: Message-ID: <20141121173127.GA15760@kroah.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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