提交 f0eae0ed 编写于 作者: J Jani Nikula 提交者: Greg Kroah-Hartman

driver-core: document ERR_PTR() return values

A number of functions in the driver core return ERR_PTR() values on
error. Document this in the kernel-doc of the functions.
Signed-off-by: NJani Nikula <ext-jani.1.nikula@nokia.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 178a5b35
......@@ -219,6 +219,8 @@ static void class_create_release(struct class *cls)
* This is used to create a struct class pointer that can then be used
* in calls to device_create().
*
* Returns &struct class pointer on success, or ERR_PTR() on error.
*
* Note, the pointer created here is to be destroyed when finished by
* making a call to class_destroy().
*/
......
......@@ -1345,6 +1345,8 @@ static void root_device_release(struct device *dev)
* 'module' symlink which points to the @owner directory
* in sysfs.
*
* Returns &struct device pointer on success, or ERR_PTR() on error.
*
* Note: You probably want to use root_device_register().
*/
struct device *__root_device_register(const char *name, struct module *owner)
......@@ -1432,6 +1434,8 @@ static void device_create_release(struct device *dev)
* Any further sysfs files that might be required can be created using this
* pointer.
*
* Returns &struct device pointer on success, or ERR_PTR() on error.
*
* Note: the struct class passed to this function must have previously
* been created with a call to class_create().
*/
......@@ -1492,6 +1496,8 @@ EXPORT_SYMBOL_GPL(device_create_vargs);
* Any further sysfs files that might be required can be created using this
* pointer.
*
* Returns &struct device pointer on success, or ERR_PTR() on error.
*
* Note: the struct class passed to this function must have previously
* been created with a call to class_create().
*/
......
......@@ -362,6 +362,8 @@ EXPORT_SYMBOL_GPL(platform_device_unregister);
* enumeration tasks, they don't fully conform to the Linux driver model.
* In particular, when such drivers are built as modules, they can't be
* "hotplugged".
*
* Returns &struct platform_device pointer on success, or ERR_PTR() on error.
*/
struct platform_device *platform_device_register_simple(const char *name,
int id,
......@@ -408,6 +410,8 @@ EXPORT_SYMBOL_GPL(platform_device_register_simple);
* allocated for the device allows drivers using such devices to be
* unloaded without waiting for the last reference to the device to be
* dropped.
*
* Returns &struct platform_device pointer on success, or ERR_PTR() on error.
*/
struct platform_device *platform_device_register_data(
struct device *parent,
......@@ -559,6 +563,8 @@ EXPORT_SYMBOL_GPL(platform_driver_probe);
*
* Use this in legacy-style modules that probe hardware directly and
* register a single platform device and corresponding platform driver.
*
* Returns &struct platform_device pointer on success, or ERR_PTR() on error.
*/
struct platform_device * __init_or_module platform_create_bundle(
struct platform_driver *driver,
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册