Commit d505855e authored by Bryan Thompson's avatar Bryan Thompson Committed by Greg Kroah-Hartman

staging: unisys: visorbus: Make visordriver_callback_lock a mutex

visordriver_callback_lock is just a binary semaphore that logically
makes more sense as a mutex.
Signed-off-by: default avatarBryan Thompson <bryan.thompson@unisys.com>
Signed-off-by: default avatarDavid Kershner <david.kershner@unisys.com>
Reviewed-by: default avatarTim Sell <Timothy.Sell@unisys.com>
Acked-By: default avatarNeil Horman <nhorman@tuxdriver.com>
Reviewed-by: default avatarThomas Gleixner <tglx@linutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8a64f954
...@@ -161,7 +161,7 @@ struct visor_device { ...@@ -161,7 +161,7 @@ struct visor_device {
struct timer_list timer; struct timer_list timer;
bool timer_active; bool timer_active;
bool being_removed; bool being_removed;
struct semaphore visordriver_callback_lock; struct mutex visordriver_callback_lock;
bool pausing; bool pausing;
bool resuming; bool resuming;
u32 chipset_bus_no; u32 chipset_bus_no;
......
...@@ -574,7 +574,7 @@ visordriver_probe_device(struct device *xdev) ...@@ -574,7 +574,7 @@ visordriver_probe_device(struct device *xdev)
if (!drv->probe) if (!drv->probe)
return -ENODEV; return -ENODEV;
down(&dev->visordriver_callback_lock); mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = false; dev->being_removed = false;
res = drv->probe(dev); res = drv->probe(dev);
...@@ -584,7 +584,7 @@ visordriver_probe_device(struct device *xdev) ...@@ -584,7 +584,7 @@ visordriver_probe_device(struct device *xdev)
fix_vbus_dev_info(dev); fix_vbus_dev_info(dev);
} }
up(&dev->visordriver_callback_lock); mutex_unlock(&dev->visordriver_callback_lock);
return res; return res;
} }
...@@ -600,11 +600,11 @@ visordriver_remove_device(struct device *xdev) ...@@ -600,11 +600,11 @@ visordriver_remove_device(struct device *xdev)
dev = to_visor_device(xdev); dev = to_visor_device(xdev);
drv = to_visor_driver(xdev->driver); drv = to_visor_driver(xdev->driver);
down(&dev->visordriver_callback_lock); mutex_lock(&dev->visordriver_callback_lock);
dev->being_removed = true; dev->being_removed = true;
if (drv->remove) if (drv->remove)
drv->remove(dev); drv->remove(dev);
up(&dev->visordriver_callback_lock); mutex_unlock(&dev->visordriver_callback_lock);
dev_stop_periodic_work(dev); dev_stop_periodic_work(dev);
put_device(&dev->device); put_device(&dev->device);
...@@ -764,7 +764,7 @@ create_visor_device(struct visor_device *dev) ...@@ -764,7 +764,7 @@ create_visor_device(struct visor_device *dev)
POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, chipset_dev_no, chipset_bus_no, POSTCODE_LINUX_4(DEVICE_CREATE_ENTRY_PC, chipset_dev_no, chipset_bus_no,
POSTCODE_SEVERITY_INFO); POSTCODE_SEVERITY_INFO);
sema_init(&dev->visordriver_callback_lock, 1); /* unlocked */ mutex_init(&dev->visordriver_callback_lock);
dev->device.bus = &visorbus_type; dev->device.bus = &visorbus_type;
dev->device.groups = visorbus_channel_groups; dev->device.groups = visorbus_channel_groups;
device_initialize(&dev->device); device_initialize(&dev->device);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment