Commit eafae15f authored by Simon Sandström's avatar Simon Sandström Committed by Greg Kroah-Hartman

staging: kpc2000: remove unnecessary comments in kp2000_pcie_probe

Much of the code comments in kp2000_pcie_probe just repeats the code and
does not add any additional information. Delete them and make sure that
comments still left in the function all use the same style.
Signed-off-by: default avatarSimon Sandström <simon@nikanor.nu>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent fd5a82f4
...@@ -311,18 +311,12 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, ...@@ -311,18 +311,12 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
unsigned long dma_bar_phys_len; unsigned long dma_bar_phys_len;
u16 regval; u16 regval;
/*
* Step 1: Allocate a struct for the pcard
*/
pcard = kzalloc(sizeof(*pcard), GFP_KERNEL); pcard = kzalloc(sizeof(*pcard), GFP_KERNEL);
if (!pcard) if (!pcard)
return -ENOMEM; return -ENOMEM;
dev_dbg(&pdev->dev, "probe: allocated struct kp2000_device @ %p\n", dev_dbg(&pdev->dev, "probe: allocated struct kp2000_device @ %p\n",
pcard); pcard);
/*
* Step 2: Initialize trivial pcard elements
*/
err = ida_simple_get(&card_num_ida, 1, INT_MAX, GFP_KERNEL); err = ida_simple_get(&card_num_ida, 1, INT_MAX, GFP_KERNEL);
if (err < 0) { if (err < 0) {
dev_err(&pdev->dev, "probe: failed to get card number (%d)\n", dev_err(&pdev->dev, "probe: failed to get card number (%d)\n",
...@@ -338,9 +332,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, ...@@ -338,9 +332,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
pcard->pdev = pdev; pcard->pdev = pdev;
pci_set_drvdata(pdev, pcard); pci_set_drvdata(pdev, pcard);
/*
* Step 3: Enable PCI device
*/
err = pci_enable_device(pcard->pdev); err = pci_enable_device(pcard->pdev);
if (err) { if (err) {
dev_err(&pcard->pdev->dev, dev_err(&pcard->pdev->dev,
...@@ -349,9 +340,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, ...@@ -349,9 +340,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
goto err_remove_ida; goto err_remove_ida;
} }
/* /* Setup the Register BAR */
* Step 4: Setup the Register BAR
*/
reg_bar_phys_addr = pci_resource_start(pcard->pdev, REG_BAR); reg_bar_phys_addr = pci_resource_start(pcard->pdev, REG_BAR);
reg_bar_phys_len = pci_resource_len(pcard->pdev, REG_BAR); reg_bar_phys_len = pci_resource_len(pcard->pdev, REG_BAR);
...@@ -381,9 +370,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, ...@@ -381,9 +370,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
reg_bar_phys_len - 1; reg_bar_phys_len - 1;
pcard->regs_base_resource.flags = IORESOURCE_MEM; pcard->regs_base_resource.flags = IORESOURCE_MEM;
/* /* Setup the DMA BAR */
* Step 5: Setup the DMA BAR
*/
dma_bar_phys_addr = pci_resource_start(pcard->pdev, DMA_BAR); dma_bar_phys_addr = pci_resource_start(pcard->pdev, DMA_BAR);
dma_bar_phys_len = pci_resource_len(pcard->pdev, DMA_BAR); dma_bar_phys_len = pci_resource_len(pcard->pdev, DMA_BAR);
...@@ -415,9 +402,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, ...@@ -415,9 +402,7 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
dma_bar_phys_len - 1; dma_bar_phys_len - 1;
pcard->dma_base_resource.flags = IORESOURCE_MEM; pcard->dma_base_resource.flags = IORESOURCE_MEM;
/* /* Read System Regs */
* Step 6: System Regs
*/
pcard->sysinfo_regs_base = pcard->regs_bar_base; pcard->sysinfo_regs_base = pcard->regs_bar_base;
err = read_system_regs(pcard); err = read_system_regs(pcard);
if (err) if (err)
...@@ -427,11 +412,9 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, ...@@ -427,11 +412,9 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
writeq(0xFFFFFFFFFFFFFFFF, writeq(0xFFFFFFFFFFFFFFFF,
pcard->sysinfo_regs_base + REG_INTERRUPT_MASK); pcard->sysinfo_regs_base + REG_INTERRUPT_MASK);
/*
* Step 7: Configure PCI thingies
*/
// let the card master PCIe // let the card master PCIe
pci_set_master(pcard->pdev); pci_set_master(pcard->pdev);
// enable IO and mem if not already done // enable IO and mem if not already done
pci_read_config_word(pcard->pdev, PCI_COMMAND, &regval); pci_read_config_word(pcard->pdev, PCI_COMMAND, &regval);
regval |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY); regval |= (PCI_COMMAND_IO | PCI_COMMAND_MEMORY);
...@@ -466,9 +449,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, ...@@ -466,9 +449,6 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
dev_dbg(&pcard->pdev->dev, dev_dbg(&pcard->pdev->dev,
"Using DMA mask %0llx\n", dma_get_mask(PCARD_TO_DEV(pcard))); "Using DMA mask %0llx\n", dma_get_mask(PCARD_TO_DEV(pcard)));
/*
* Step 8: Configure IRQs
*/
err = pci_enable_msi(pcard->pdev); err = pci_enable_msi(pcard->pdev);
if (err < 0) if (err < 0)
goto err_unmap_dma; goto err_unmap_dma;
...@@ -481,25 +461,17 @@ static int kp2000_pcie_probe(struct pci_dev *pdev, ...@@ -481,25 +461,17 @@ static int kp2000_pcie_probe(struct pci_dev *pdev,
goto err_disable_msi; goto err_disable_msi;
} }
/*
* Step 9: Setup sysfs attributes
*/
err = sysfs_create_files(&pdev->dev.kobj, kp_attr_list); err = sysfs_create_files(&pdev->dev.kobj, kp_attr_list);
if (err) { if (err) {
dev_err(&pdev->dev, "Failed to add sysfs files: %d\n", err); dev_err(&pdev->dev, "Failed to add sysfs files: %d\n", err);
goto err_free_irq; goto err_free_irq;
} }
/*
* Step 10: Probe cores
*/
err = kp2000_probe_cores(pcard); err = kp2000_probe_cores(pcard);
if (err) if (err)
goto err_remove_sysfs; goto err_remove_sysfs;
/* /* Enable IRQs in HW */
* Step 11: Enable IRQs in HW
*/
writel(KPC_DMA_CARD_IRQ_ENABLE | KPC_DMA_CARD_USER_INTERRUPT_MODE, writel(KPC_DMA_CARD_IRQ_ENABLE | KPC_DMA_CARD_USER_INTERRUPT_MODE,
pcard->dma_common_regs); pcard->dma_common_regs);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment