scx200_acb: Use mutex instead of semaphore
The scx200_acb driver use a semaphore as mutex. Use the mutex API instead of the (binary) semaphore. Signed-off-by: Matthias Kaehlcke <matthias.kaehlcke@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Cc: Jordan Crouse <jordan.crouse@amd.com> Signed-off-by: Jean Delvare <khali@linux-fr.org>
This commit is contained in:
parent
d75d53cd57
commit
9d9c01ceff
1 changed files with 7 additions and 7 deletions
|
@ -388,7 +388,7 @@ static const struct i2c_algorithm scx200_acb_algorithm = {
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct scx200_acb_iface *scx200_acb_list;
|
static struct scx200_acb_iface *scx200_acb_list;
|
||||||
static DECLARE_MUTEX(scx200_acb_list_mutex);
|
static DEFINE_MUTEX(scx200_acb_list_mutex);
|
||||||
|
|
||||||
static __init int scx200_acb_probe(struct scx200_acb_iface *iface)
|
static __init int scx200_acb_probe(struct scx200_acb_iface *iface)
|
||||||
{
|
{
|
||||||
|
@ -472,10 +472,10 @@ static int __init scx200_acb_create(struct scx200_acb_iface *iface)
|
||||||
return -ENODEV;
|
return -ENODEV;
|
||||||
}
|
}
|
||||||
|
|
||||||
down(&scx200_acb_list_mutex);
|
mutex_lock(&scx200_acb_list_mutex);
|
||||||
iface->next = scx200_acb_list;
|
iface->next = scx200_acb_list;
|
||||||
scx200_acb_list = iface;
|
scx200_acb_list = iface;
|
||||||
up(&scx200_acb_list_mutex);
|
mutex_unlock(&scx200_acb_list_mutex);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -633,10 +633,10 @@ static void __exit scx200_acb_cleanup(void)
|
||||||
{
|
{
|
||||||
struct scx200_acb_iface *iface;
|
struct scx200_acb_iface *iface;
|
||||||
|
|
||||||
down(&scx200_acb_list_mutex);
|
mutex_lock(&scx200_acb_list_mutex);
|
||||||
while ((iface = scx200_acb_list) != NULL) {
|
while ((iface = scx200_acb_list) != NULL) {
|
||||||
scx200_acb_list = iface->next;
|
scx200_acb_list = iface->next;
|
||||||
up(&scx200_acb_list_mutex);
|
mutex_unlock(&scx200_acb_list_mutex);
|
||||||
|
|
||||||
i2c_del_adapter(&iface->adapter);
|
i2c_del_adapter(&iface->adapter);
|
||||||
|
|
||||||
|
@ -648,9 +648,9 @@ static void __exit scx200_acb_cleanup(void)
|
||||||
release_region(iface->base, 8);
|
release_region(iface->base, 8);
|
||||||
|
|
||||||
kfree(iface);
|
kfree(iface);
|
||||||
down(&scx200_acb_list_mutex);
|
mutex_lock(&scx200_acb_list_mutex);
|
||||||
}
|
}
|
||||||
up(&scx200_acb_list_mutex);
|
mutex_unlock(&scx200_acb_list_mutex);
|
||||||
}
|
}
|
||||||
|
|
||||||
module_init(scx200_acb_init);
|
module_init(scx200_acb_init);
|
||||||
|
|
Loading…
Add table
Reference in a new issue