Commit 2dc024e9 authored by yizhouzhou@ict.ac.cn's avatar yizhouzhou@ict.ac.cn Committed by Jesper Nilsson

cris: return of class_create should be considered

Return value of class_create should be considered in module init function.
Signed-off-by: default avatarZhouyi Zhou <zhouzhouyi@gmail.com>
Signed-off-by: default avatarJesper Nilsson <jespern@axis.com>
parent 11c2ecdc
......@@ -1627,6 +1627,12 @@ static int __init etrax_sync_serial_init(void)
/* Create a sysfs class for syncser */
syncser_class = class_create(THIS_MODULE, "syncser_class");
if (IS_ERR(syncser_class)) {
pr_err("Failed to create a sysfs class for syncser\n");
unregister_chrdev_region(syncser_first, minor_count);
cdev_del(syncser_cdev);
return -1;
}
/* Initialize Ports */
#if defined(CONFIG_ETRAX_SYNCHRONOUS_SERIAL_PORT0)
......
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