[POWERPC] mv64x60: Use mutex instead of semaphore

Signed-off-by: Christoph Hellwig <hch@lst.de>
Acked-by: Mark A. Greer <mgreer@mvista.com>
Signed-off-by: Paul Mackerras <paulus@samba.org>

authored by Christoph Hellwig and committed by Paul Mackerras 461e6667 adff093d

+8 -7
+8 -7
arch/ppc/syslib/mv64x60.c
··· 14 14 #include <linux/pci.h> 15 15 #include <linux/slab.h> 16 16 #include <linux/module.h> 17 + #include <linux/mutex.h> 17 18 #include <linux/string.h> 18 19 #include <linux/spinlock.h> 19 20 #include <linux/mv643xx.h> ··· 2360 2359 /* Export the hotswap register via sysfs for enum event monitoring */ 2361 2360 #define VAL_LEN_MAX 11 /* 32-bit hex or dec stringified number + '\n' */ 2362 2361 2363 - DECLARE_MUTEX(mv64xxx_hs_lock); 2362 + static DEFINE_MUTEX(mv64xxx_hs_lock); 2364 2363 2365 2364 static ssize_t 2366 2365 mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count) ··· 2373 2372 if (count < VAL_LEN_MAX) 2374 2373 return -EINVAL; 2375 2374 2376 - if (down_interruptible(&mv64xxx_hs_lock)) 2375 + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) 2377 2376 return -ERESTARTSYS; 2378 2377 save_exclude = mv64x60_pci_exclude_bridge; 2379 2378 mv64x60_pci_exclude_bridge = 0; 2380 2379 early_read_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0), 2381 2380 MV64360_PCICFG_CPCI_HOTSWAP, &v); 2382 2381 mv64x60_pci_exclude_bridge = save_exclude; 2383 - up(&mv64xxx_hs_lock); 2382 + mutex_unlock(&mv64xxx_hs_lock); 2384 2383 2385 2384 return sprintf(buf, "0x%08x\n", v); 2386 2385 } ··· 2397 2396 return -EINVAL; 2398 2397 2399 2398 if (sscanf(buf, "%i", &v) == 1) { 2400 - if (down_interruptible(&mv64xxx_hs_lock)) 2399 + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) 2401 2400 return -ERESTARTSYS; 2402 2401 save_exclude = mv64x60_pci_exclude_bridge; 2403 2402 mv64x60_pci_exclude_bridge = 0; 2404 2403 early_write_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0), 2405 2404 MV64360_PCICFG_CPCI_HOTSWAP, v); 2406 2405 mv64x60_pci_exclude_bridge = save_exclude; 2407 - up(&mv64xxx_hs_lock); 2406 + mutex_unlock(&mv64xxx_hs_lock); 2408 2407 } 2409 2408 else 2410 2409 count = -EINVAL; ··· 2434 2433 pdev = container_of(dev, struct platform_device, dev); 2435 2434 pdp = (struct mv64xxx_pdata *)pdev->dev.platform_data; 2436 2435 2437 - if (down_interruptible(&mv64xxx_hs_lock)) 2436 + if (mutex_lock_interruptible(&mv64xxx_hs_lock)) 2438 2437 return -ERESTARTSYS; 2439 2438 v = pdp->hs_reg_valid; 2440 - up(&mv64xxx_hs_lock); 2439 + mutex_unlock(&mv64xxx_hs_lock); 2441 2440 2442 2441 return sprintf(buf, "%i\n", v); 2443 2442 }