diff options
author | Olivier Blin <oblin@mandriva.com> | 2008-02-27 17:38:47 +0000 |
---|---|---|
committer | Olivier Blin <oblin@mandriva.com> | 2008-02-27 17:38:47 +0000 |
commit | 7d8ffcb66365d786eecc88b349b70a3a1c55e0de (patch) | |
tree | a5a7a5f94b7434ced8b1a2672292e65a8395404b /pciusb.c | |
parent | fa69af91173a4d2a33db80fe05e362e4dd6c307d (diff) | |
download | ldetect-7d8ffcb66365d786eecc88b349b70a3a1c55e0de.tar ldetect-7d8ffcb66365d786eecc88b349b70a3a1c55e0de.tar.gz ldetect-7d8ffcb66365d786eecc88b349b70a3a1c55e0de.tar.bz2 ldetect-7d8ffcb66365d786eecc88b349b70a3a1c55e0de.tar.xz ldetect-7d8ffcb66365d786eecc88b349b70a3a1c55e0de.zip |
set module in find_modules_through_aliases_one
Diffstat (limited to 'pciusb.c')
-rw-r--r-- | pciusb.c | 15 |
1 files changed, 6 insertions, 9 deletions
@@ -73,7 +73,7 @@ void set_modules_from_modalias(struct pciusb_entry *e, char *modalias) { } } -static char *find_modalias(const char *bus, struct pciusb_entry *e) { +static void find_modules_through_aliases_one(const char *bus, struct pciusb_entry *e) { char *modalias = NULL; char *modalias_path; FILE *file; @@ -84,18 +84,19 @@ static char *find_modalias(const char *bus, struct pciusb_entry *e) { if (-1 == getline(&modalias, &n, file)) { fprintf(stderr, "Unable to read modalias from %s\n", modalias_path); fclose(file); - return NULL; + return; } fclose(file); size = strlen(modalias); if (size) modalias[size-1] = 0; + + set_modules_from_modalias(e, modalias); } else { fprintf(stderr, "Unable to read modalias from %s\n", modalias_path); - return NULL; + return; } free(modalias_path); - return modalias; } static void find_modules_through_aliases(const char *bus, struct pciusb_entries *entries) { @@ -108,11 +109,7 @@ static void find_modules_through_aliases(const char *bus, struct pciusb_entries // No special case found in pcitable ? Then lookup modalias for PCI devices if (e->module && strcmp(e->module, "unknown")) continue; - - char *modalias = find_modalias(bus, e); - if (modalias) { - set_modules_from_modalias(e, modalias); - } + find_modules_through_aliases_one(bus, e); } } |