aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/pci-sysfs.c
diff options
context:
space:
mode:
authorZhao, Yu <yu.zhao@intel.com>2008-10-13 07:18:07 -0400
committerJesse Barnes <jbarnes@virtuousgeek.org>2008-10-20 13:54:29 -0400
commit557848c3c03ad1d1e66cb3b5b06698e3a9ebc33c (patch)
treef244d69c332d3bbbef9f924fb1f0892abba7e1ff /drivers/pci/pci-sysfs.c
parent022edd86d7c864bc8fadc3c8ac4e6a464472ab05 (diff)
PCI: replace cfg space size (256/4096) by macros.
This is a cleanup that changes all PCI configuration space size representations to the macros (PCI_CFG_SPACE_SIZE and PCI_CFG_SPACE_EXP_SIZE). And the macros are also moved from drivers/pci/probe.c to drivers/pci/pci.h. Signed-off-by: Yu Zhao <yu.zhao@intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/pci-sysfs.c')
-rw-r--r--drivers/pci/pci-sysfs.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/pci/pci-sysfs.c b/drivers/pci/pci-sysfs.c
index 77baff022f71..00a9947cb7cc 100644
--- a/drivers/pci/pci-sysfs.c
+++ b/drivers/pci/pci-sysfs.c
@@ -715,7 +715,7 @@ static struct bin_attribute pci_config_attr = {
715 .name = "config", 715 .name = "config",
716 .mode = S_IRUGO | S_IWUSR, 716 .mode = S_IRUGO | S_IWUSR,
717 }, 717 },
718 .size = 256, 718 .size = PCI_CFG_SPACE_SIZE,
719 .read = pci_read_config, 719 .read = pci_read_config,
720 .write = pci_write_config, 720 .write = pci_write_config,
721}; 721};
@@ -725,7 +725,7 @@ static struct bin_attribute pcie_config_attr = {
725 .name = "config", 725 .name = "config",
726 .mode = S_IRUGO | S_IWUSR, 726 .mode = S_IRUGO | S_IWUSR,
727 }, 727 },
728 .size = 4096, 728 .size = PCI_CFG_SPACE_EXP_SIZE,
729 .read = pci_read_config, 729 .read = pci_read_config,
730 .write = pci_write_config, 730 .write = pci_write_config,
731}; 731};
@@ -743,7 +743,7 @@ int __must_check pci_create_sysfs_dev_files (struct pci_dev *pdev)
743 if (!sysfs_initialized) 743 if (!sysfs_initialized)
744 return -EACCES; 744 return -EACCES;
745 745
746 if (pdev->cfg_size < 4096) 746 if (pdev->cfg_size < PCI_CFG_SPACE_EXP_SIZE)
747 retval = sysfs_create_bin_file(&pdev->dev.kobj, &pci_config_attr); 747 retval = sysfs_create_bin_file(&pdev->dev.kobj, &pci_config_attr);
748 else 748 else
749 retval = sysfs_create_bin_file(&pdev->dev.kobj, &pcie_config_attr); 749 retval = sysfs_create_bin_file(&pdev->dev.kobj, &pcie_config_attr);
@@ -814,7 +814,7 @@ err_vpd:
814 kfree(pdev->vpd->attr); 814 kfree(pdev->vpd->attr);
815 } 815 }
816err_config_file: 816err_config_file:
817 if (pdev->cfg_size < 4096) 817 if (pdev->cfg_size < PCI_CFG_SPACE_EXP_SIZE)
818 sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr); 818 sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
819 else 819 else
820 sysfs_remove_bin_file(&pdev->dev.kobj, &pcie_config_attr); 820 sysfs_remove_bin_file(&pdev->dev.kobj, &pcie_config_attr);
@@ -839,7 +839,7 @@ void pci_remove_sysfs_dev_files(struct pci_dev *pdev)
839 sysfs_remove_bin_file(&pdev->dev.kobj, pdev->vpd->attr); 839 sysfs_remove_bin_file(&pdev->dev.kobj, pdev->vpd->attr);
840 kfree(pdev->vpd->attr); 840 kfree(pdev->vpd->attr);
841 } 841 }
842 if (pdev->cfg_size < 4096) 842 if (pdev->cfg_size < PCI_CFG_SPACE_EXP_SIZE)
843 sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr); 843 sysfs_remove_bin_file(&pdev->dev.kobj, &pci_config_attr);
844 else 844 else
845 sysfs_remove_bin_file(&pdev->dev.kobj, &pcie_config_attr); 845 sysfs_remove_bin_file(&pdev->dev.kobj, &pcie_config_attr);