diff options
author | Jonathan Nieder <jrnieder@gmail.com> | 2012-02-21 01:43:21 -0600 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-02-22 20:54:53 +0000 |
commit | eab14db2e96cc69a7509bf557276e808a010abb5 (patch) | |
tree | 8ff58c389a9300e5f2bcd2aee71e374832999716 | |
parent | 0cd009d9d0c56f473ae5a6234916800aa708bb36 (diff) |
avivotool: make card detection and mapping errors non-fatal
After radeontool-1.6.0~28 ("add more ram dumping stuff") avivotool
tries to detect a Radeon unconditionally, even for the romtables
subcommand that doesn't require one. To keep avivotool useful when
there is an error detecting a card, the patch changed the fatal error
codepath to keep going rather than exiting.
That had some unpleasant side effects, so make lack of a card and
other card detection trouble into non-fatal errors as preparation for
making die() exit again.
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
-rw-r--r-- | avivotool.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/avivotool.c b/avivotool.c index 5db6371..4f12d11 100644 --- a/avivotool.c +++ b/avivotool.c @@ -1799,8 +1799,10 @@ static int map_radeon_mem(void) struct pci_device *device; int i = 0; - if (pci_system_init() != 0) - die("failed to initialise libpciaccess"); + if (pci_system_init() != 0) { + fprintf(stderr, "error: failed to initialise libpciaccess\n"); + return -1; + } #if 0 match.vendor_id = 0x1002; @@ -1865,8 +1867,10 @@ static int map_radeon_mem(void) return -1; } - if (pci_device_map_region(avivo_device, ctrl_region, 1) != 0) - die("mapping ctrl region"); + if (pci_device_map_region(avivo_device, ctrl_region, 1) != 0) { + fprintf(stderr, "error: mapping ctrl region\n"); + return -1; + } ctrl_mem = avivo_device->regions[ctrl_region].memory; if (pci_device_map_region(avivo_device, fb_region, 1) == 0) |