summaryrefslogtreecommitdiff
path: root/kernel-devel/module-basics/vain_pci/vain_pci_3.c
blob: 765afaa399afc0d2edfbff1ed97a3fb45dfaeda2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
	ret = pci_request_regions(pdev, "vain_pci");
	if (ret) {
		dev_err(&pdev->dev, "I/O address 0x%04x already in use\n");
		goto err_disable_device;
	}

	info->base = pci_ioremap_bar(pdev, 0);
	if (!info->base) {
		dev_err(&pdev->dev, "Unable to map card MMIO\n");
		ret = -ENODEV;
		goto err_rel_regs;
	}

	pci_set_drvdata(pdev, info);

	return 0;