+ mutex_lock(&dev->sw_mutex);
else
DPRINTF("device %d not found\n", id);
swconfig_unlock();
else
DPRINTF("device %d not found\n", id);
swconfig_unlock();
static inline void
swconfig_put_dev(struct switch_dev *dev)
{
static inline void
swconfig_put_dev(struct switch_dev *dev)
{
- spin_unlock(&dev->lock);
+ mutex_unlock(&dev->sw_mutex);
return -ENOMEM;
}
swconfig_defaults_init(dev);
return -ENOMEM;
}
swconfig_defaults_init(dev);
- spin_lock_init(&dev->lock);
+ mutex_init(&dev->sw_mutex);
swconfig_lock();
dev->id = ++swdev_id;
swconfig_lock();
dev->id = ++swdev_id;
{
swconfig_destroy_led_trigger(dev);
kfree(dev->portbuf);
{
swconfig_destroy_led_trigger(dev);
kfree(dev->portbuf);
+ mutex_lock(&dev->sw_mutex);
swconfig_lock();
list_del(&dev->dev_list);
swconfig_unlock();
swconfig_lock();
list_del(&dev->dev_list);
swconfig_unlock();
- spin_unlock(&dev->lock);
+ mutex_unlock(&dev->sw_mutex);
}
EXPORT_SYMBOL_GPL(unregister_switch);
}
EXPORT_SYMBOL_GPL(unregister_switch);
struct list_head dev_list;
unsigned long def_global, def_port, def_vlan;
struct list_head dev_list;
unsigned long def_global, def_port, def_vlan;
struct switch_port *portbuf;
char buf[128];
struct switch_port *portbuf;
char buf[128];