From: ppisa Date: Sat, 18 Feb 2006 01:29:12 +0000 (+0000) Subject: Corrected incorrect check of class_device_create() return code validity. X-Git-Tag: CLT_COMM_CAN-lincan-0_3_3~7 X-Git-Url: http://rtime.felk.cvut.cz/gitweb/lincan.git/commitdiff_plain/32049a92a5397cc9c525e1e1974d866e136f4429 Corrected incorrect check of class_device_create() return code validity. Noticed by Sergei Sharonov. --- diff --git a/lincan/src/main.c b/lincan/src/main.c index c4fb22a..92d7966 100644 --- a/lincan/src/main.c +++ b/lincan/src/main.c @@ -313,10 +313,11 @@ int init_module(void) #else /* >= 2.6.15 */ this_dev=class_device_create(can_class, NULL, MKDEV(major, dev_minor), NULL, "can%d", dev_minor); #endif /* >= 2.6.15 */ - if(!this_dev){ + if(IS_ERR(this_dev)){ CANMSG("problem to create device \"can%d\" in the class \"can\"\n", dev_minor); }else{ - this_dev->class_data=objects_p[i]; + /*this_dev->class_data=objects_p[i];*/ + class_set_devdata(this_dev,objects_p[i]); } #ifdef CONFIG_DEVFS_FS devfs_mk_cdev(MKDEV(major, dev_minor), S_IFCHR | S_IRUGO | S_IWUGO, "can%d", dev_minor);