Switch linux-core from using dev->pdev->driver->name to
dev->driver->pci_driver.name. This avoids the stealth mode case where pdev is pointing to the wrong driver or no driver.main
parent
5ae6c5af75
commit
7ebbebf3d3
|
@ -109,12 +109,12 @@ int drm_setunique(struct inode *inode, struct file *filp,
|
|||
|
||||
dev->unique[dev->unique_len] = '\0';
|
||||
|
||||
dev->devname = drm_alloc(strlen(dev->pdev->driver->name) + strlen(dev->unique) + 2,
|
||||
dev->devname = drm_alloc(strlen(dev->driver->pci_driver.name) + strlen(dev->unique) + 2,
|
||||
DRM_MEM_DRIVER);
|
||||
if (!dev->devname)
|
||||
return -ENOMEM;
|
||||
|
||||
sprintf(dev->devname, "%s@%s", dev->pdev->driver->name, dev->unique);
|
||||
sprintf(dev->devname, "%s@%s", dev->driver->pci_driver.name, dev->unique);
|
||||
|
||||
/* Return error if the busid submitted doesn't match the device's actual
|
||||
* busid.
|
||||
|
@ -149,12 +149,12 @@ static int drm_set_busid(drm_device_t * dev)
|
|||
if (len > dev->unique_len)
|
||||
DRM_ERROR("buffer overflow");
|
||||
|
||||
dev->devname = drm_alloc(strlen(dev->pdev->driver->name) + dev->unique_len + 2,
|
||||
dev->devname = drm_alloc(strlen(dev->driver->pci_driver.name) + dev->unique_len + 2,
|
||||
DRM_MEM_DRIVER);
|
||||
if (dev->devname == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
sprintf(dev->devname, "%s@%s", dev->pdev->driver->name, dev->unique);
|
||||
sprintf(dev->devname, "%s@%s", dev->driver->pci_driver.name, dev->unique);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
|
|
@ -175,10 +175,10 @@ static int drm_name_info(char *buf, char **start, off_t offset, int request,
|
|||
|
||||
if (dev->unique) {
|
||||
DRM_PROC_PRINT("%s %s %s\n",
|
||||
dev->pdev->driver->name, pci_name(dev->pdev),
|
||||
dev->driver->pci_driver.name, pci_name(dev->pdev),
|
||||
dev->unique);
|
||||
} else {
|
||||
DRM_PROC_PRINT("%s %s\n", dev->pdev->driver->name,
|
||||
DRM_PROC_PRINT("%s %s\n", dev->driver->pci_driver.name,
|
||||
pci_name(dev->pdev));
|
||||
}
|
||||
|
||||
|
|
|
@ -255,7 +255,7 @@ err_g1:
|
|||
*/
|
||||
int drm_put_dev(drm_device_t * dev)
|
||||
{
|
||||
DRM_DEBUG("release primary %s\n", dev->pdev->driver->name);
|
||||
DRM_DEBUG("release primary %s\n", dev->driver->pci_driver.name);
|
||||
|
||||
if (dev->unique) {
|
||||
drm_free(dev->unique, strlen(dev->unique) + 1, DRM_MEM_DRIVER);
|
||||
|
|
Loading…
Reference in New Issue