summaryrefslogtreecommitdiff
path: root/lib/intel_chipset.c
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-26 15:13:06 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2014-08-26 15:16:01 +0200
commit71ac5de5a4473d20fb11cb454f62d8e5c90f020c (patch)
treed90ebcf85b8f7f674aeb0a2d2df81a430673de66 /lib/intel_chipset.c
parentbaa6f8b34f54b68c15fc86d86de77d954e458aac (diff)
lib/intel_* Use igt checks and macros
Various stuff all over. Most done with the igt.cocci spatch, but with a few fixups by hand. And add igt_core.h includes where needed. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Diffstat (limited to 'lib/intel_chipset.c')
-rw-r--r--lib/intel_chipset.c17
1 files changed, 6 insertions, 11 deletions
diff --git a/lib/intel_chipset.c b/lib/intel_chipset.c
index 54d55ac0..0828e444 100644
--- a/lib/intel_chipset.c
+++ b/lib/intel_chipset.c
@@ -39,6 +39,7 @@
#include "i915_drm.h"
#include "intel_chipset.h"
+#include "igt_core.h"
/**
* SECTION:intel_chipset
@@ -74,11 +75,8 @@ intel_get_pci_device(void)
int error;
error = pci_system_init();
- if (error != 0) {
- fprintf(stderr, "Couldn't initialize PCI system: %s\n",
- strerror(error));
- exit(1);
- }
+ igt_fail_on_f(error != 0,
+ "Couldn't initialize PCI system\n");
/* Grab the graphics card. Try the canonical slot first, then
* walk the entire PCI bus for a matching device. */
@@ -105,11 +103,8 @@ intel_get_pci_device(void)
errx(1, "Couldn't find graphics card");
error = pci_device_probe(pci_dev);
- if (error != 0) {
- fprintf(stderr, "Couldn't probe graphics card: %s\n",
- strerror(error));
- exit(1);
- }
+ igt_fail_on_f(error != 0,
+ "Couldn't probe graphics card\n");
if (pci_dev->vendor_id != 0x8086)
errx(1, "Graphics card is non-intel");
@@ -145,7 +140,7 @@ intel_get_drm_devid(int fd)
gp.value = (int *)&devid;
ret = ioctl(fd, DRM_IOCTL_I915_GETPARAM, &gp, sizeof(gp));
- assert(ret == 0);
+ igt_assert(ret == 0);
errno = 0;
}