diff options
author | Matthias Kaehlcke <matthias.kaehlcke@gmail.com> | 2007-07-12 08:12:28 -0400 |
---|---|---|
committer | Jean Delvare <khali@hyperion.delvare> | 2007-07-12 08:12:28 -0400 |
commit | 9d9c01ceff00fcba50043f500cac471ecf6752c9 (patch) | |
tree | c9760a35ff6afe6e859a268d765d52d44db91449 /drivers/i2c | |
parent | d75d53cd571c02990d56e72f615ab11e943772f9 (diff) |
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>
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/scx200_acb.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/i2c/busses/scx200_acb.c b/drivers/i2c/busses/scx200_acb.c index 0d6bd4f7b7fa..dc64f8b6b24a 100644 --- a/drivers/i2c/busses/scx200_acb.c +++ b/drivers/i2c/busses/scx200_acb.c | |||
@@ -388,7 +388,7 @@ static const struct i2c_algorithm scx200_acb_algorithm = { | |||
388 | }; | 388 | }; |
389 | 389 | ||
390 | static struct scx200_acb_iface *scx200_acb_list; | 390 | static struct scx200_acb_iface *scx200_acb_list; |
391 | static DECLARE_MUTEX(scx200_acb_list_mutex); | 391 | static DEFINE_MUTEX(scx200_acb_list_mutex); |
392 | 392 | ||
393 | static __init int scx200_acb_probe(struct scx200_acb_iface *iface) | 393 | static __init int scx200_acb_probe(struct scx200_acb_iface *iface) |
394 | { | 394 | { |
@@ -472,10 +472,10 @@ static int __init scx200_acb_create(struct scx200_acb_iface *iface) | |||
472 | return -ENODEV; | 472 | return -ENODEV; |
473 | } | 473 | } |
474 | 474 | ||
475 | down(&scx200_acb_list_mutex); | 475 | mutex_lock(&scx200_acb_list_mutex); |
476 | iface->next = scx200_acb_list; | 476 | iface->next = scx200_acb_list; |
477 | scx200_acb_list = iface; | 477 | scx200_acb_list = iface; |
478 | up(&scx200_acb_list_mutex); | 478 | mutex_unlock(&scx200_acb_list_mutex); |
479 | 479 | ||
480 | return 0; | 480 | return 0; |
481 | } | 481 | } |
@@ -633,10 +633,10 @@ static void __exit scx200_acb_cleanup(void) | |||
633 | { | 633 | { |
634 | struct scx200_acb_iface *iface; | 634 | struct scx200_acb_iface *iface; |
635 | 635 | ||
636 | down(&scx200_acb_list_mutex); | 636 | mutex_lock(&scx200_acb_list_mutex); |
637 | while ((iface = scx200_acb_list) != NULL) { | 637 | while ((iface = scx200_acb_list) != NULL) { |
638 | scx200_acb_list = iface->next; | 638 | scx200_acb_list = iface->next; |
639 | up(&scx200_acb_list_mutex); | 639 | mutex_unlock(&scx200_acb_list_mutex); |
640 | 640 | ||
641 | i2c_del_adapter(&iface->adapter); | 641 | i2c_del_adapter(&iface->adapter); |
642 | 642 | ||
@@ -648,9 +648,9 @@ static void __exit scx200_acb_cleanup(void) | |||
648 | release_region(iface->base, 8); | 648 | release_region(iface->base, 8); |
649 | 649 | ||
650 | kfree(iface); | 650 | kfree(iface); |
651 | down(&scx200_acb_list_mutex); | 651 | mutex_lock(&scx200_acb_list_mutex); |
652 | } | 652 | } |
653 | up(&scx200_acb_list_mutex); | 653 | mutex_unlock(&scx200_acb_list_mutex); |
654 | } | 654 | } |
655 | 655 | ||
656 | module_init(scx200_acb_init); | 656 | module_init(scx200_acb_init); |