if (!i2c_dev) /* attach_adapter must have failed */
return 0;
+ cdev_del(&i2c_dev->cdev);
put_i2c_dev(i2c_dev);
device_destroy(i2c_dev_class, MKDEV(I2C_MAJOR, adap->nr));
- cdev_del(&i2c_dev->cdev);
pr_debug("i2c-dev: adapter [%s] unregistered\n", adap->name);
return 0;