diff options
author | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-12-22 11:51:38 +0000 |
---|---|---|
committer | Jannis Pohlmann <jannis.pohlmann@codethink.co.uk> | 2012-12-22 11:51:38 +0000 |
commit | 8821237240c5374d83298b2da5ad88fa1e3c1ef7 (patch) | |
tree | e1bc03fa83c61165f48ffe3f528ac5496332872a /com32/lib/pci/scan.c | |
parent | 38dcca25c8855c95649e3f0b5b09fae862ed5c7a (diff) | |
parent | 7307d60063ee4303da4de45f9d984fdc8df92146 (diff) | |
download | syslinux-8821237240c5374d83298b2da5ad88fa1e3c1ef7.tar.gz |
Merge remote-tracking branch 'remotes/upstream/master' into baserock/morph
Diffstat (limited to 'com32/lib/pci/scan.c')
-rw-r--r-- | com32/lib/pci/scan.c | 24 |
1 files changed, 5 insertions, 19 deletions
diff --git a/com32/lib/pci/scan.c b/com32/lib/pci/scan.c index c8334b11..fe00fc25 100644 --- a/com32/lib/pci/scan.c +++ b/com32/lib/pci/scan.c @@ -41,12 +41,7 @@ #include <stdbool.h> #include <ctype.h> #include <syslinux/zio.h> - -#ifdef DEBUG -# define dprintf printf -#else -# define dprintf(...) ((void)0) -#endif +#include <dprintf.h> #define MAX_LINE 512 @@ -66,15 +61,6 @@ static int hex_to_int(char *hexa) return strtoul(hexa, NULL, 16); } -/* Replace char 'old' by char 'new' in source */ -void chr_replace(char *source, char old, char new) -{ - while (*source) { - source++; - if (source[0] == old) source[0]=new; - } -} - /* Try to match any pci device to the appropriate kernel module */ /* it uses the modules.pcimap from the boot device */ int get_module_name_from_pcimap(struct pci_domain *domain, @@ -135,7 +121,7 @@ int get_module_name_from_pcimap(struct pci_domain *domain, * in the module name whereas modules.alias is only using '_'. * To avoid kernel modules duplication, let's rename all '-' in '_' * to match what modules.alias provides */ - case 0:chr_replace(result,'-','_');strcpy(module_name,result); break; + case 0:chrreplace(result,'-','_');strcpy(module_name,result); break; case 1:strcpy(vendor_id,result); break; case 2:strcpy(product_id,result); break; case 3:strcpy(sub_vendor_id,result); break; @@ -593,14 +579,14 @@ void free_pci_domain(struct pci_domain *domain) free(func->dev_info); free(func); } - free(slot); } + free(slot); } - free(bus); } + free(bus); } - free(domain); } + free(domain); } } |