The semantic patch that makes this change is as follows:
(http://www.emn.fr/x-info/coccinelle/)
// <smpl>
@def@
declarer DEFINE_MUTEX;
identifier m;
@@
DEFINE_MUTEX(m);
@@
identifier def.m;
@@
(
- spin_lock(&m)
+ mutex_lock(&m)
|
- spin_unlock(&m)
+ mutex_unlock(&m)
)
// </smpl>
Signed-off-by: Julia Lawall <julia@diku.dk>
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
if (copy_to_user((struct rtc_time *) arg, &tm,
sizeof tm)) {
- spin_unlock(&rtc_lock);
+ mutex_unlock(&rtc_lock);
return -EFAULT;
}
if (copy_to_user((struct rtc_time *) arg, &tm,
sizeof tm)) {
- spin_unlock(&rtc_lock);
+ mutex_unlock(&rtc_lock);
return -EFAULT;
}