Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 62595
b: refs/heads/master
c: 461e666
h: refs/heads/master
i:
  62593: 6dbf809
  62591: 8e466cf
v: v3
  • Loading branch information
Christoph Hellwig authored and Paul Mackerras committed Jul 22, 2007
1 parent cb718c0 commit 1a32dbc
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: adff093d6c545c882f1503607f6af14ddd90bb89
refs/heads/master: 461e666723b6669bc6f7ef90b49b615396d70eb8
15 changes: 8 additions & 7 deletions trunk/arch/ppc/syslib/mv64x60.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <linux/pci.h>
#include <linux/slab.h>
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/string.h>
#include <linux/spinlock.h>
#include <linux/mv643xx.h>
Expand Down Expand Up @@ -2359,7 +2360,7 @@ mv64460_chip_specific_init(struct mv64x60_handle *bh,
/* Export the hotswap register via sysfs for enum event monitoring */
#define VAL_LEN_MAX 11 /* 32-bit hex or dec stringified number + '\n' */

DECLARE_MUTEX(mv64xxx_hs_lock);
static DEFINE_MUTEX(mv64xxx_hs_lock);

static ssize_t
mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
Expand All @@ -2372,14 +2373,14 @@ mv64xxx_hs_reg_read(struct kobject *kobj, char *buf, loff_t off, size_t count)
if (count < VAL_LEN_MAX)
return -EINVAL;

if (down_interruptible(&mv64xxx_hs_lock))
if (mutex_lock_interruptible(&mv64xxx_hs_lock))
return -ERESTARTSYS;
save_exclude = mv64x60_pci_exclude_bridge;
mv64x60_pci_exclude_bridge = 0;
early_read_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0),
MV64360_PCICFG_CPCI_HOTSWAP, &v);
mv64x60_pci_exclude_bridge = save_exclude;
up(&mv64xxx_hs_lock);
mutex_unlock(&mv64xxx_hs_lock);

return sprintf(buf, "0x%08x\n", v);
}
Expand All @@ -2396,14 +2397,14 @@ mv64xxx_hs_reg_write(struct kobject *kobj, char *buf, loff_t off, size_t count)
return -EINVAL;

if (sscanf(buf, "%i", &v) == 1) {
if (down_interruptible(&mv64xxx_hs_lock))
if (mutex_lock_interruptible(&mv64xxx_hs_lock))
return -ERESTARTSYS;
save_exclude = mv64x60_pci_exclude_bridge;
mv64x60_pci_exclude_bridge = 0;
early_write_config_dword(&sysfs_hose_a, 0, PCI_DEVFN(0, 0),
MV64360_PCICFG_CPCI_HOTSWAP, v);
mv64x60_pci_exclude_bridge = save_exclude;
up(&mv64xxx_hs_lock);
mutex_unlock(&mv64xxx_hs_lock);
}
else
count = -EINVAL;
Expand Down Expand Up @@ -2433,10 +2434,10 @@ mv64xxx_hs_reg_valid_show(struct device *dev, struct device_attribute *attr,
pdev = container_of(dev, struct platform_device, dev);
pdp = (struct mv64xxx_pdata *)pdev->dev.platform_data;

if (down_interruptible(&mv64xxx_hs_lock))
if (mutex_lock_interruptible(&mv64xxx_hs_lock))
return -ERESTARTSYS;
v = pdp->hs_reg_valid;
up(&mv64xxx_hs_lock);
mutex_unlock(&mv64xxx_hs_lock);

return sprintf(buf, "%i\n", v);
}
Expand Down

0 comments on commit 1a32dbc

Please sign in to comment.