Commit 41c31f6a authored by Nicholas Mc Guire's avatar Nicholas Mc Guire Committed by Jonathan Corbet

Documentation: devres: note checking needs when converting

There are a number of cases where conversions to devm_* API have been
done but developers forgot that this conversion may imply that return
values need to be checked for failure of internal resource handling
like allocation. While this should be clear, it does seem to be a
relatively common issue with API conversions or maybe "managed" is
being misunderstood ? So add a note to make the scope of "managed" clear.
Signed-off-by: default avatarNicholas Mc Guire <hofrat@osadl.org>
Signed-off-by: default avatarJonathan Corbet <corbet@lwn.net>
parent fdf0345e
...@@ -132,6 +132,13 @@ devres. Complexity is shifted from less maintained low level drivers ...@@ -132,6 +132,13 @@ devres. Complexity is shifted from less maintained low level drivers
to better maintained higher layer. Also, as init failure path is to better maintained higher layer. Also, as init failure path is
shared with exit path, both can get more testing. shared with exit path, both can get more testing.
Note though that when converting current calls or assignments to
managed devm_* versions it is up to you to check if internal operations
like allocating memory, have failed. Managed resources pertains to the
freeing of these resources *only* - all other checks needed are still
on you. In some cases this may mean introducing checks that were not
necessary before moving to the managed devm_* calls.
3. Devres group 3. Devres group
--------------- ---------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment