Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 28598
b: refs/heads/master
c: bdee9d9
h: refs/heads/master
v: v3
  • Loading branch information
Doug Thompson authored and Greg Kroah-Hartman committed Jun 21, 2006
1 parent 7af7224 commit 4342059
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: acc7c2e0b73a46122ec370bf8a3aa9f19065d331
refs/heads/master: bdee9d98d281d84718eaff6bf0dd2b6ad418b36f
24 changes: 24 additions & 0 deletions trunk/drivers/pci/pci-sysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,28 @@ pci_config_attr(class, "0x%06x\n");
pci_config_attr(irq, "%u\n");
pci_config_attr(is_enabled, "%u\n");

static ssize_t broken_parity_status_show(struct device *dev,
struct device_attribute *attr,
char *buf)
{
struct pci_dev *pdev = to_pci_dev(dev);
return sprintf (buf, "%u\n", pdev->broken_parity_status);
}

static ssize_t broken_parity_status_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
{
struct pci_dev *pdev = to_pci_dev(dev);
ssize_t consumed = -EINVAL;

if ((count > 0) && (*buf == '0' || *buf == '1')) {
pdev->broken_parity_status = *buf == '1' ? 1 : 0;
consumed = count;
}
return consumed;
}

static ssize_t local_cpus_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
Expand Down Expand Up @@ -122,6 +144,8 @@ struct device_attribute pci_dev_attrs[] = {
__ATTR_RO(local_cpus),
__ATTR_RO(modalias),
__ATTR(enable, 0600, is_enabled_show, is_enabled_store),
__ATTR(broken_parity_status,(S_IRUGO|S_IWUSR),
broken_parity_status_show,broken_parity_status_store),
__ATTR_NULL,
};

Expand Down

0 comments on commit 4342059

Please sign in to comment.