Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

ps3: gelic: assoc_stat_lock semaphore to mutex

Signed-off-by: Daniel Walker <dwalker@mvista.com>
Acked-by: Masakazu Mokuno <mokuno@sm.sony.co.jp>
Signed-off-by: John W. Linville <linville@tuxdriver.com>

authored by

Daniel Walker and committed by
John W. Linville
bb2d67a3 706ddd60

+12 -12
+11 -11
drivers/net/ps3_gelic_wireless.c
··· 240 240 u32 ret; 241 241 242 242 pr_debug("%s: <-\n", __func__); 243 - down(&wl->assoc_stat_lock); 243 + mutex_lock(&wl->assoc_stat_lock); 244 244 if (wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED) 245 245 ret = 1; 246 246 else 247 247 ret = 0; 248 - up(&wl->assoc_stat_lock); 248 + mutex_unlock(&wl->assoc_stat_lock); 249 249 pr_debug("%s: ->\n", __func__); 250 250 return ret; 251 251 } ··· 979 979 unsigned long irqflag; 980 980 981 981 pr_debug("%s: <- \n", __func__); 982 - down(&wl->assoc_stat_lock); 982 + mutex_lock(&wl->assoc_stat_lock); 983 983 spin_lock_irqsave(&wl->lock, irqflag); 984 984 if (test_bit(GELIC_WL_STAT_ESSID_SET, &wl->stat) || 985 985 wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED) { ··· 989 989 } else 990 990 data->essid.flags = 0; 991 991 992 - up(&wl->assoc_stat_lock); 992 + mutex_unlock(&wl->assoc_stat_lock); 993 993 spin_unlock_irqrestore(&wl->lock, irqflag); 994 994 pr_debug("%s: -> len=%d \n", __func__, data->essid.length); 995 995 ··· 1170 1170 unsigned long irqflag; 1171 1171 1172 1172 pr_debug("%s: <-\n", __func__); 1173 - down(&wl->assoc_stat_lock); 1173 + mutex_lock(&wl->assoc_stat_lock); 1174 1174 spin_lock_irqsave(&wl->lock, irqflag); 1175 1175 if (wl->assoc_stat == GELIC_WL_ASSOC_STAT_ASSOCIATED) { 1176 1176 data->ap_addr.sa_family = ARPHRD_ETHER; ··· 1180 1180 memset(data->ap_addr.sa_data, 0, ETH_ALEN); 1181 1181 1182 1182 spin_unlock_irqrestore(&wl->lock, irqflag); 1183 - up(&wl->assoc_stat_lock); 1183 + mutex_unlock(&wl->assoc_stat_lock); 1184 1184 pr_debug("%s: ->\n", __func__); 1185 1185 return 0; 1186 1186 } ··· 2151 2151 * As it waits with timeout, just leave assoc_done 2152 2152 * uncompleted, then it terminates with timeout 2153 2153 */ 2154 - if (down_trylock(&wl->assoc_stat_lock)) { 2154 + if (!mutex_trylock(&wl->assoc_stat_lock)) { 2155 2155 pr_debug("%s: already locked\n", __func__); 2156 2156 lock = 0; 2157 2157 } else { ··· 2170 2170 netif_carrier_off(port_to_netdev(wl_port(wl))); 2171 2171 2172 2172 if (lock) 2173 - up(&wl->assoc_stat_lock); 2173 + mutex_unlock(&wl->assoc_stat_lock); 2174 2174 } 2175 2175 /* 2176 2176 * event worker ··· 2258 2258 2259 2259 wl = container_of(work, struct gelic_wl_info, assoc_work.work); 2260 2260 2261 - down(&wl->assoc_stat_lock); 2261 + mutex_lock(&wl->assoc_stat_lock); 2262 2262 2263 2263 if (wl->assoc_stat != GELIC_WL_ASSOC_STAT_DISCONN) 2264 2264 goto out; ··· 2304 2304 scan_lock_out: 2305 2305 mutex_unlock(&wl->scan_lock); 2306 2306 out: 2307 - up(&wl->assoc_stat_lock); 2307 + mutex_unlock(&wl->assoc_stat_lock); 2308 2308 } 2309 2309 /* 2310 2310 * Interrupt handler ··· 2432 2432 INIT_DELAYED_WORK(&wl->event_work, gelic_wl_event_worker); 2433 2433 INIT_DELAYED_WORK(&wl->assoc_work, gelic_wl_assoc_worker); 2434 2434 mutex_init(&wl->scan_lock); 2435 - init_MUTEX(&wl->assoc_stat_lock); 2435 + mutex_init(&wl->assoc_stat_lock); 2436 2436 2437 2437 init_completion(&wl->scan_done); 2438 2438 /* for the case that no scan request is issued and stop() is called */
+1 -1
drivers/net/ps3_gelic_wireless.h
··· 266 266 enum gelic_wl_wpa_level wpa_level; /* wpa/wpa2 */ 267 267 268 268 /* association handling */ 269 - struct semaphore assoc_stat_lock; 269 + struct mutex assoc_stat_lock; 270 270 struct delayed_work assoc_work; 271 271 enum gelic_wl_assoc_state assoc_stat; 272 272 struct completion assoc_done;