[PATCH 4/4] xfree86: fbdevhw: simplify fbdev_open_pci function
Tiago Vignatti
tiago.vignatti at nokia.com
Tue Sep 7 05:18:49 PDT 2010
delete unused namep.
Signed-off-by: Tiago Vignatti <tiago.vignatti at nokia.com>
---
hw/xfree86/fbdevhw/fbdevhw.c | 20 ++++----------------
1 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/hw/xfree86/fbdevhw/fbdevhw.c b/hw/xfree86/fbdevhw/fbdevhw.c
index d57e07e..f2035f8 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -268,7 +268,7 @@ fbdev2xfree_timing(struct fb_var_screeninfo *var, DisplayModePtr mode)
* Try to find the framebuffer device for a given PCI device
*/
static int
-fbdev_open_pci(struct pci_device * pPci, char **namep)
+fbdev_open_pci(struct pci_device * pPci)
{
struct fb_fix_screeninfo fix;
char filename[256];
@@ -299,14 +299,9 @@ fbdev_open_pci(struct pci_device * pPci, char **namep)
fd = open(filename, O_RDWR, 0);
if (fd != -1) {
- if (ioctl(fd, FBIOGET_FSCREENINFO, (void*) & fix) != -1) {
- if (namep) {
- *namep = xnfalloc(16);
- strncpy(*namep,fix.id,16);
- }
-
+ if (ioctl(fd, FBIOGET_FSCREENINFO, (void*) & fix) != -1)
return fd;
- }
+
close(fd);
}
}
@@ -349,16 +344,9 @@ fbdev_open_pci(struct pci_device * pPci, char **namep)
close(fd);
continue;
}
- if (namep) {
- *namep = xnfalloc(16);
- strncpy(*namep,fix.id,16);
- }
return fd;
}
- if (namep)
- *namep = NULL;
-
xf86DrvMsg(-1, X_ERROR,
"Unable to find a valid framebuffer device\n");
return -1;
@@ -428,7 +416,7 @@ fbdevHWInit(ScrnInfoPtr pScrn, struct pci_device * pPci, char *device)
/* open device */
if (pPci)
- fPtr->fd = fbdev_open_pci(pPci,NULL);
+ fPtr->fd = fbdev_open_pci(pPci);
else
fPtr->fd = fbdev_open(pScrn->scrnIndex,device,NULL);
if (-1 == fPtr->fd) {
--
1.7.1.226.g770c5
More information about the xorg-devel
mailing list