diff options
author | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-06-21 04:54:17 -0400 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-06-21 15:43:46 -0400 |
commit | 46bfdf9a2e8e7067e5e452e0d668d98becd89dbc (patch) | |
tree | b57d7fe59885fbc7bba27df3e34049aeca282b0f /drivers/gpu/drm/drm_pci.c | |
parent | a742946a1ba57e24e8be205ea87224c05b38c380 (diff) |
drm: Nuke SET_UNIQUE ioctl
Ever since
commit 2e1868b560315a8b20d688e646c489a5ad93eeae
Author: Eric Anholt <anholt@freebsd.org>
Date: Wed Jun 16 09:25:21 2004 +0000
DRI trunk-20040613 import
the X server supports drm 1.1, thus doesn't call call libdrm's
drmSetBusid - the sole user of this ioctl. When reviewing this note
that for hilarity both the kernel-internal functions (set_busid) and
the libdrm wrapper (drmSetBusid) have names not matching this ioctl
(SET_UNIQUE).
v2: Polish commit message (Emil).
Cc: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1466499262-18717-6-git-send-email-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/drm_pci.c')
-rw-r--r-- | drivers/gpu/drm/drm_pci.c | 51 |
1 files changed, 0 insertions, 51 deletions
diff --git a/drivers/gpu/drm/drm_pci.c b/drivers/gpu/drm/drm_pci.c index 29d5a548d07a..b2f8f1062d5f 100644 --- a/drivers/gpu/drm/drm_pci.c +++ b/drivers/gpu/drm/drm_pci.c | |||
@@ -144,50 +144,6 @@ int drm_pci_set_busid(struct drm_device *dev, struct drm_master *master) | |||
144 | } | 144 | } |
145 | EXPORT_SYMBOL(drm_pci_set_busid); | 145 | EXPORT_SYMBOL(drm_pci_set_busid); |
146 | 146 | ||
147 | int drm_pci_set_unique(struct drm_device *dev, | ||
148 | struct drm_master *master, | ||
149 | struct drm_unique *u) | ||
150 | { | ||
151 | int domain, bus, slot, func, ret; | ||
152 | |||
153 | master->unique_len = u->unique_len; | ||
154 | master->unique = kmalloc(master->unique_len + 1, GFP_KERNEL); | ||
155 | if (!master->unique) { | ||
156 | ret = -ENOMEM; | ||
157 | goto err; | ||
158 | } | ||
159 | |||
160 | if (copy_from_user(master->unique, u->unique, master->unique_len)) { | ||
161 | ret = -EFAULT; | ||
162 | goto err; | ||
163 | } | ||
164 | |||
165 | master->unique[master->unique_len] = '\0'; | ||
166 | |||
167 | /* Return error if the busid submitted doesn't match the device's actual | ||
168 | * busid. | ||
169 | */ | ||
170 | ret = sscanf(master->unique, "PCI:%d:%d:%d", &bus, &slot, &func); | ||
171 | if (ret != 3) { | ||
172 | ret = -EINVAL; | ||
173 | goto err; | ||
174 | } | ||
175 | |||
176 | domain = bus >> 8; | ||
177 | bus &= 0xff; | ||
178 | |||
179 | if ((domain != drm_get_pci_domain(dev)) || | ||
180 | (bus != dev->pdev->bus->number) || | ||
181 | (slot != PCI_SLOT(dev->pdev->devfn)) || | ||
182 | (func != PCI_FUNC(dev->pdev->devfn))) { | ||
183 | ret = -EINVAL; | ||
184 | goto err; | ||
185 | } | ||
186 | return 0; | ||
187 | err: | ||
188 | return ret; | ||
189 | } | ||
190 | |||
191 | static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p) | 147 | static int drm_pci_irq_by_busid(struct drm_device *dev, struct drm_irq_busid *p) |
192 | { | 148 | { |
193 | if ((p->busnum >> 8) != drm_get_pci_domain(dev) || | 149 | if ((p->busnum >> 8) != drm_get_pci_domain(dev) || |
@@ -444,13 +400,6 @@ int drm_irq_by_busid(struct drm_device *dev, void *data, | |||
444 | { | 400 | { |
445 | return -EINVAL; | 401 | return -EINVAL; |
446 | } | 402 | } |
447 | |||
448 | int drm_pci_set_unique(struct drm_device *dev, | ||
449 | struct drm_master *master, | ||
450 | struct drm_unique *u) | ||
451 | { | ||
452 | return -EINVAL; | ||
453 | } | ||
454 | #endif | 403 | #endif |
455 | 404 | ||
456 | EXPORT_SYMBOL(drm_pci_init); | 405 | EXPORT_SYMBOL(drm_pci_init); |