/* Use an arbitrary short delay to combine multiple reset requests. */
fw_card_get(card);
- if (!queue_delayed_work(fw_wq, &card->br_work,
+ if (!queue_delayed_work(fw_workqueue, &card->br_work,
delayed ? DIV_ROUND_UP(HZ, 100) : 0))
fw_card_put(card);
}
/* Delay for 2s after last reset per IEEE 1394 clause 8.2.1. */
if (card->reset_jiffies != 0 &&
time_before64(get_jiffies_64(), card->reset_jiffies + 2 * HZ)) {
- if (!queue_delayed_work(fw_wq, &card->br_work, 2 * HZ))
+ if (!queue_delayed_work(fw_workqueue, &card->br_work, 2 * HZ))
fw_card_put(card);
return;
}
static void schedule_iso_resource(struct iso_resource *r, unsigned long delay)
{
client_get(r->client);
- if (!queue_delayed_work(fw_wq, &r->work, delay))
+ if (!queue_delayed_work(fw_workqueue, &r->work, delay))
client_put(r->client);
}
return device;
}
-struct workqueue_struct *fw_wq;
+struct workqueue_struct *fw_workqueue;
+EXPORT_SYMBOL(fw_workqueue);
static void fw_schedule_device_work(struct fw_device *device,
unsigned long delay)
{
- queue_delayed_work(fw_wq, &device->work, delay);
+ queue_delayed_work(fw_workqueue, &device->work, delay);
}
/*
{
int ret;
- fw_wq = alloc_workqueue(KBUILD_MODNAME,
- WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
- if (!fw_wq)
+ fw_workqueue = alloc_workqueue("firewire",
+ WQ_NON_REENTRANT | WQ_MEM_RECLAIM, 0);
+ if (!fw_workqueue)
return -ENOMEM;
ret = bus_register(&fw_bus_type);
if (ret < 0) {
- destroy_workqueue(fw_wq);
+ destroy_workqueue(fw_workqueue);
return ret;
}
fw_cdev_major = register_chrdev(0, "firewire", &fw_device_ops);
if (fw_cdev_major < 0) {
bus_unregister(&fw_bus_type);
- destroy_workqueue(fw_wq);
+ destroy_workqueue(fw_workqueue);
return fw_cdev_major;
}
{
unregister_chrdev(fw_cdev_major, "firewire");
bus_unregister(&fw_bus_type);
- destroy_workqueue(fw_wq);
+ destroy_workqueue(fw_workqueue);
idr_destroy(&fw_device_idr);
}
extern struct rw_semaphore fw_device_rwsem;
extern struct idr fw_device_idr;
extern int fw_cdev_major;
-struct workqueue_struct;
-extern struct workqueue_struct *fw_wq;
struct fw_device *fw_device_get_by_devt(dev_t devt);
int fw_device_set_broadcast_channel(struct device *dev, void *gen);
kref_put(&tgt->kref, sbp2_release_target);
}
-static struct workqueue_struct *sbp2_wq;
-
/*
* Always get the target's kref when scheduling work on one its units.
* Each workqueue job is responsible to call sbp2_target_put() upon return.
static void sbp2_queue_work(struct sbp2_logical_unit *lu, unsigned long delay)
{
sbp2_target_get(lu->tgt);
- if (!queue_delayed_work(sbp2_wq, &lu->work, delay))
+ if (!queue_delayed_work(fw_workqueue, &lu->work, delay))
sbp2_target_put(lu->tgt);
}
static int __init sbp2_init(void)
{
- sbp2_wq = create_singlethread_workqueue(KBUILD_MODNAME);
- if (!sbp2_wq)
- return -ENOMEM;
-
return driver_register(&sbp2_driver.driver);
}
static void __exit sbp2_cleanup(void)
{
driver_unregister(&sbp2_driver.driver);
- destroy_workqueue(sbp2_wq);
}
module_init(sbp2_init);
u64 channels_mask, int *channel, int *bandwidth,
bool allocate);
+extern struct workqueue_struct *fw_workqueue;
+
#endif /* _LINUX_FIREWIRE_H */