Changeset 9147 for src/linux/ar531x/linux-2.6.24/net/bluetooth/hci_sysfs.c
- Timestamp:
- 02/29/08 03:29:18 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/linux/ar531x/linux-2.6.24/net/bluetooth/hci_sysfs.c
r8935 r9147 13 13 #define BT_DBG(D...) 14 14 #endif 15 static struct workqueue_struct *btaddconn; 16 static struct workqueue_struct *btdelconn; 15 17 16 18 static inline char *typetostr(int type) … … 280 282 int i; 281 283 284 flush_workqueue(btdelconn); 282 285 if (device_add(&conn->dev) < 0) { 283 286 BT_ERR("Failed to register connection device"); … … 314 317 INIT_WORK(&conn->work, add_conn); 315 318 319 queue_work(btaddconn, &conn->work); 316 320 schedule_work(&conn->work); 317 321 } … … 350 354 INIT_WORK(&conn->work, del_conn); 351 355 356 queue_work(btdelconn, &conn->work); 352 357 schedule_work(&conn->work); 353 358 } … … 399 404 int err; 400 405 406 btaddconn = create_singlethread_workqueue("btaddconn"); 407 if (!btaddconn) { 408 err = -ENOMEM; 409 goto out; 410 } 411 btdelconn = create_singlethread_workqueue("btdelconn"); 412 if (!btdelconn) { 413 err = -ENOMEM; 414 goto out_del; 415 } 416 401 417 bt_platform = platform_device_register_simple("bluetooth", -1, NULL, 0); 402 if (IS_ERR(bt_platform)) 403 return PTR_ERR(bt_platform); 418 if (IS_ERR(bt_platform)) { 419 err = PTR_ERR(bt_platform); 420 goto out_platform; 421 } 404 422 405 423 err = bus_register(&bt_bus); 406 if (err < 0) { 407 platform_device_unregister(bt_platform); 408 return err; 409 } 424 if (err < 0) 425 goto out_bus; 410 426 411 427 bt_class = class_create(THIS_MODULE, "bluetooth"); 412 428 if (IS_ERR(bt_class)) { 413 bus_unregister(&bt_bus); 414 platform_device_unregister(bt_platform); 415 return PTR_ERR(bt_class); 429 err = PTR_ERR(bt_class); 430 goto out_class; 416 431 } 417 432 418 433 return 0; 434 435 out_class: 436 bus_unregister(&bt_bus); 437 out_bus: 438 platform_device_unregister(bt_platform); 439 out_platform: 440 destroy_workqueue(btdelconn); 441 out_del: 442 destroy_workqueue(btaddconn); 443 out: 444 return err; 419 445 } 420 446 421 447 void bt_sysfs_cleanup(void) 422 448 { 449 destroy_workqueue(btaddconn); 450 destroy_workqueue(btdelconn); 423 451 class_destroy(bt_class); 424 425 452 bus_unregister(&bt_bus); 426 427 453 platform_device_unregister(bt_platform); 428 454 }
Note: See TracChangeset
for help on using the changeset viewer.
