<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/drivers/base/devres.c, branch v3.12.14</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/drivers/base/devres.c?h=v3.12.14</id>
<link rel='self' href='https://git.amat.us/linux/atom/drivers/base/devres.c?h=v3.12.14'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2013-03-18T02:40:50Z</updated>
<entry>
<title>Merge tag 'v3.9-rc3' into next</title>
<updated>2013-03-18T02:40:50Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2013-03-18T02:40:50Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=688d794c4c3f8b08c814381ee2edd3ede5856056'/>
<id>urn:sha1:688d794c4c3f8b08c814381ee2edd3ede5856056</id>
<content type='text'>
Merge with mainline to bring in module_platform_driver_probe() and
devm_ioremap_resource().
</content>
</entry>
<entry>
<title>devres: allow adding custom actions to the stack</title>
<updated>2013-02-26T07:02:42Z</updated>
<author>
<name>Dmitry Torokhov</name>
<email>dmitry.torokhov@gmail.com</email>
</author>
<published>2013-02-23T21:11:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d6b0c58048d2c8c6f4955c37f670125b2792cd14'/>
<id>urn:sha1:d6b0c58048d2c8c6f4955c37f670125b2792cd14</id>
<content type='text'>
Sometimes drivers need to execute one-off actions in their error handling
or device teardown paths. An example would be toggling a GPIO line to
reset the controlled device into predefined state.

To allow performing such actions when using managed resources let's allow
adding them to stack/group of devres resources.

Acked-by: Tejun Heo &lt;tj@kernel.org&gt;
Acked-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Signed-off-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>drivers: base: Convert dev_printk(KERN_&lt;LEVEL&gt; to dev_&lt;level&gt;(</title>
<updated>2012-10-31T00:38:43Z</updated>
<author>
<name>Joe Perches</name>
<email>joe@perches.com</email>
</author>
<published>2012-10-28T08:05:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=a369a7ebbfce5caa38e3d5645ea050f4590dea7a'/>
<id>urn:sha1:a369a7ebbfce5caa38e3d5645ea050f4590dea7a</id>
<content type='text'>
dev_&lt;level&gt; calls take less code than dev_printk(KERN_&lt;LEVEL&gt;
and reducing object size is good.

Signed-off-by: Joe Perches &lt;joe@perches.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>driver core: devres: introduce devres_for_each_res</title>
<updated>2012-08-16T20:30:29Z</updated>
<author>
<name>Ming Lei</name>
<email>ming.lei@canonical.com</email>
</author>
<published>2012-08-04T04:01:26Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=bddb1b9078505bb0e430c87c5015c0963f7a594f'/>
<id>urn:sha1:bddb1b9078505bb0e430c87c5015c0963f7a594f</id>
<content type='text'>
This patch introduces one devres API of devres_for_each_res
so that the device's driver can iterate each resource it has
interest in.

The firmware loader will use the API to get each firmware name
from the device instance.

Signed-off-by: Ming Lei &lt;ming.lei@canonical.com&gt;
Cc: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devres: Add devres_release()</title>
<updated>2012-05-04T23:33:16Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-05-03T17:15:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=d926d0e4c74cfcb42a05e91d1cdf698b41e1e118'/>
<id>urn:sha1:d926d0e4c74cfcb42a05e91d1cdf698b41e1e118</id>
<content type='text'>
APIs using devres frequently want to implement a "remove and free the
resource" operation so it seems sensible that they should be able to
just have devres do the freeing for them since that's a big part of what
devres is all about.

Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devres: Clarify documentation for devres_destroy()</title>
<updated>2012-05-04T23:33:16Z</updated>
<author>
<name>Mark Brown</name>
<email>broonie@opensource.wolfsonmicro.com</email>
</author>
<published>2012-05-03T17:15:12Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=698cd2ddd851b34e7200b4f846ae68306e11bae4'/>
<id>urn:sha1:698cd2ddd851b34e7200b4f846ae68306e11bae4</id>
<content type='text'>
It's not massively obvious (at least to me) that removing and freeing a
resource does not involve calling the release function for the resource
but rather only removes the management of it. Make the documentation more
explicit.

Signed-off-by: Mark Brown &lt;broonie@opensource.wolfsonmicro.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>devres: Fix a typo in devm_kfree comment</title>
<updated>2011-12-20T23:31:47Z</updated>
<author>
<name>Axel Lin</name>
<email>axel.lin@gmail.com</email>
</author>
<published>2011-12-20T07:17:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=92f1b8518708c085ed7d07d8e7ed36411c92fa4f'/>
<id>urn:sha1:92f1b8518708c085ed7d07d8e7ed36411c92fa4f</id>
<content type='text'>
Signed-off-by: Axel Lin &lt;axel.lin@gmail.com&gt;
Signed-off-by: Jiri Kosina &lt;jkosina@suse.cz&gt;
</content>
</entry>
<entry>
<title>base/devres.c: quiet sparse noise about context imbalance</title>
<updated>2011-08-22T21:12:24Z</updated>
<author>
<name>H Hartley Sweeten</name>
<email>hartleys@visionengravers.com</email>
</author>
<published>2011-08-12T21:58:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=86ec67fd0a28c7f2b765e33aaf5b002d28c5f1fa'/>
<id>urn:sha1:86ec67fd0a28c7f2b765e33aaf5b002d28c5f1fa</id>
<content type='text'>
devres_release_all and devres_release_group both aquire the lock
&amp;dev-&gt;devres_lock but the release of that lock is done in release_nodes.
This results in sparse noise about context imbalance.

Add a lock annotation to release_nodes to quiet this noise.

Signed-off-by: H Hartley Sweeten &lt;hsweeten@visionengravers.com&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;
</content>
</entry>
<entry>
<title>include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h</title>
<updated>2010-03-30T13:02:32Z</updated>
<author>
<name>Tejun Heo</name>
<email>tj@kernel.org</email>
</author>
<published>2010-03-24T08:04:11Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5a0e3ad6af8660be21ca98a971cd00f331318c05'/>
<id>urn:sha1:5a0e3ad6af8660be21ca98a971cd00f331318c05</id>
<content type='text'>
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -&gt; slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo &lt;tj@kernel.org&gt;
Guess-its-ok-by: Christoph Lameter &lt;cl@linux-foundation.org&gt;
Cc: Ingo Molnar &lt;mingo@redhat.com&gt;
Cc: Lee Schermerhorn &lt;Lee.Schermerhorn@hp.com&gt;
</content>
</entry>
<entry>
<title>devres: WARN() and return, don't crash on device_del() of uninitialized device</title>
<updated>2009-07-12T20:02:09Z</updated>
<author>
<name>Benjamin Herrenschmidt</name>
<email>benh@kernel.crashing.org</email>
</author>
<published>2009-06-10T19:43:02Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=eb8d3c604fe7496323efb9a858bef84c489ca584'/>
<id>urn:sha1:eb8d3c604fe7496323efb9a858bef84c489ca584</id>
<content type='text'>
I just debugged an obscure crash caused by a device_del() of a all NULL'd
out struct device (in usb-serial) and found that a patch like this one would
have saved me time (in addition to improved chances of a bug report from
users hitting similar driver bugs).

[akpm@linux-foundation.org: cleanup]
Signed-off-by: Benjamin Herrenschmidt &lt;benh@kernel.crashing.org&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Tejun Heo &lt;tj@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Greg Kroah-Hartman &lt;gregkh@suse.de&gt;

</content>
</entry>
</feed>
