Skip to content

Commit c4e6752

Browse files
Geoff Levandpaulusmack
authored andcommitted
[POWERPC] PS3: Vuart: change semaphore to mutex
A general housekeeping change of the PS3 vuart variable vuart_bus_priv.probe_mutex from semaphore to mutex. Signed-off-by: Geoff Levand <geoffrey.levand@am.sony.com> Signed-off-by: Paul Mackerras <paulus@samba.org>
1 parent 781749a commit c4e6752

1 file changed

Lines changed: 11 additions & 11 deletions

File tree

‎drivers/ps3/ps3-vuart.c‎

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ static int ps3_vuart_handle_port_interrupt(struct ps3_system_bus_device *dev)
877877
struct vuart_bus_priv {
878878
struct ports_bmp *bmp;
879879
unsigned int virq;
880-
struct semaphore probe_mutex;
880+
struct mutex probe_mutex;
881881
int use_count;
882882
struct ps3_system_bus_device *devices[PORT_COUNT];
883883
} static vuart_bus_priv;
@@ -1015,7 +1015,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
10151015
return -EINVAL;
10161016
}
10171017

1018-
down(&vuart_bus_priv.probe_mutex);
1018+
mutex_lock(&vuart_bus_priv.probe_mutex);
10191019

10201020
result = ps3_vuart_bus_interrupt_get();
10211021

@@ -1075,7 +1075,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
10751075
goto fail_probe;
10761076
}
10771077

1078-
up(&vuart_bus_priv.probe_mutex);
1078+
mutex_unlock(&vuart_bus_priv.probe_mutex);
10791079

10801080
return result;
10811081

@@ -1088,7 +1088,7 @@ static int ps3_vuart_probe(struct ps3_system_bus_device *dev)
10881088
fail_busy:
10891089
ps3_vuart_bus_interrupt_put();
10901090
fail_setup_interrupt:
1091-
up(&vuart_bus_priv.probe_mutex);
1091+
mutex_unlock(&vuart_bus_priv.probe_mutex);
10921092
dev_dbg(&dev->core, "%s:%d: failed\n", __func__, __LINE__);
10931093
return result;
10941094
}
@@ -1127,15 +1127,15 @@ static int ps3_vuart_remove(struct ps3_system_bus_device *dev)
11271127

11281128
BUG_ON(!dev);
11291129

1130-
down(&vuart_bus_priv.probe_mutex);
1130+
mutex_lock(&vuart_bus_priv.probe_mutex);
11311131

11321132
dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
11331133
dev->match_id);
11341134

11351135
if (!dev->core.driver) {
11361136
dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
11371137
__LINE__);
1138-
up(&vuart_bus_priv.probe_mutex);
1138+
mutex_unlock(&vuart_bus_priv.probe_mutex);
11391139
return 0;
11401140
}
11411141

@@ -1158,7 +1158,7 @@ static int ps3_vuart_remove(struct ps3_system_bus_device *dev)
11581158
priv = NULL;
11591159

11601160
dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
1161-
up(&vuart_bus_priv.probe_mutex);
1161+
mutex_unlock(&vuart_bus_priv.probe_mutex);
11621162
return 0;
11631163
}
11641164

@@ -1178,15 +1178,15 @@ static int ps3_vuart_shutdown(struct ps3_system_bus_device *dev)
11781178

11791179
BUG_ON(!dev);
11801180

1181-
down(&vuart_bus_priv.probe_mutex);
1181+
mutex_lock(&vuart_bus_priv.probe_mutex);
11821182

11831183
dev_dbg(&dev->core, " -> %s:%d: match_id %d\n", __func__, __LINE__,
11841184
dev->match_id);
11851185

11861186
if (!dev->core.driver) {
11871187
dev_dbg(&dev->core, "%s:%d: no driver bound\n", __func__,
11881188
__LINE__);
1189-
up(&vuart_bus_priv.probe_mutex);
1189+
mutex_unlock(&vuart_bus_priv.probe_mutex);
11901190
return 0;
11911191
}
11921192

@@ -1210,7 +1210,7 @@ static int ps3_vuart_shutdown(struct ps3_system_bus_device *dev)
12101210

12111211
dev_dbg(&dev->core, " <- %s:%d\n", __func__, __LINE__);
12121212

1213-
up(&vuart_bus_priv.probe_mutex);
1213+
mutex_unlock(&vuart_bus_priv.probe_mutex);
12141214
return 0;
12151215
}
12161216

@@ -1221,7 +1221,7 @@ static int __init ps3_vuart_bus_init(void)
12211221
if (!firmware_has_feature(FW_FEATURE_PS3_LV1))
12221222
return -ENODEV;
12231223

1224-
init_MUTEX(&vuart_bus_priv.probe_mutex);
1224+
mutex_init(&vuart_bus_priv.probe_mutex);
12251225

12261226
return 0;
12271227
}

0 commit comments

Comments
 (0)