/* temp init ATM device, set to 128kbit */
atm_dev->link_rate = 128 * 1000 / 424;
+ ret = sysfs_create_link(&atm_dev->class_dev.kobj,
+ &instance->usb_intf->dev.kobj, "device");
+ if (ret) {
+ atm_err(instance, "%s: sysfs_create_link failed: %d\n",
+ __func__, ret);
+ goto fail_sysfs;
+ }
+
if (instance->driver->atm_start && ((ret = instance->driver->atm_start(instance, atm_dev)) < 0)) {
atm_err(instance, "%s: atm_start failed: %d!\n", __func__, ret);
goto fail;
return 0;
fail:
+ sysfs_remove_link(&atm_dev->class_dev.kobj, "device");
+ fail_sysfs:
instance->atm_dev = NULL;
atm_dev_deregister(atm_dev); /* usbatm_atm_dev_close will eventually be called */
return ret;
kfree(instance->cell_buf);
/* ATM finalize */
- if (instance->atm_dev)
+ if (instance->atm_dev) {
+ sysfs_remove_link(&instance->atm_dev->class_dev.kobj, "device");
atm_dev_deregister(instance->atm_dev);
+ }
usbatm_put_instance(instance); /* taken in usbatm_usb_probe */
}