1
0
Fork 0
mirror of https://git.rwth-aachen.de/acs/public/villas/node/ synced 2025-03-09 00:00:00 +01:00

kernel/pci: make some arguments const and fix debug output

This commit is contained in:
Daniel Krebs 2018-03-26 15:40:58 +02:00
parent 60882f1086
commit 2724622787
2 changed files with 8 additions and 8 deletions

View file

@ -58,13 +58,13 @@ int pci_device_compare(const struct pci_device *d, const struct pci_device *f);
struct pci_device * pci_lookup_device(struct pci *p, struct pci_device *filter);
/** Get currently loaded driver for device */
int pci_get_driver(struct pci_device *d, char *buf, size_t buflen);
int pci_get_driver(const struct pci_device *d, char *buf, size_t buflen);
/** Bind a new LKM to the PCI device */
int pci_attach_driver(struct pci_device *d, const char *driver);
int pci_attach_driver(const struct pci_device *d, const char *driver);
/** Return the IOMMU group of this PCI device or -1 if the device is not in a group. */
int pci_get_iommu_group(struct pci_device *d);
int pci_get_iommu_group(const struct pci_device *d);
#ifdef __cplusplus
}

View file

@ -254,7 +254,7 @@ struct pci_device * pci_lookup_device(struct pci *p, struct pci_device *f)
return list_search(&p->devices, (cmp_cb_t) pci_device_compare, (void *) f);
}
int pci_get_driver(struct pci_device *d, char *buf, size_t buflen)
int pci_get_driver(const struct pci_device *d, char *buf, size_t buflen)
{
int ret;
char sysfs[1024], syml[1024];
@ -273,7 +273,7 @@ int pci_get_driver(struct pci_device *d, char *buf, size_t buflen)
return 0;
}
int pci_attach_driver(struct pci_device *d, const char *driver)
int pci_attach_driver(const struct pci_device *d, const char *driver)
{
FILE *f;
char fn[1024];
@ -284,7 +284,7 @@ int pci_attach_driver(struct pci_device *d, const char *driver)
if (!f)
serror("Failed to add PCI id to %s driver (%s)", driver, fn);
debug(5, "Adding ID to %s module: %04x %04x", driver, d->id.vendor, d->id.device);
info("Adding ID to %s module: %04x %04x", driver, d->id.vendor, d->id.device);
fprintf(f, "%04x %04x", d->id.vendor, d->id.device);
fclose(f);
@ -294,14 +294,14 @@ int pci_attach_driver(struct pci_device *d, const char *driver)
if (!f)
serror("Failed to bind PCI device to %s driver (%s)", driver, fn);
debug(5, "Bind device to %s driver", driver);
info("Bind device to %s driver", driver);
fprintf(f, "%04x:%02x:%02x.%x\n", d->slot.domain, d->slot.bus, d->slot.device, d->slot.function);
fclose(f);
return 0;
}
int pci_get_iommu_group(struct pci_device *d)
int pci_get_iommu_group(const struct pci_device *d)
{
int ret;
char *group, link[1024], sysfs[1024];