[prev in list] [next in list] [prev in thread] [next in thread]
List: freedesktop-xorg-devel
Subject: [PATCH 4/6] xfree86: fbdevhw: simplify fbdev_open_pci function
From: Tiago Vignatti <tiago.vignatti () nokia ! com>
Date: 2010-05-31 13:16:54
Message-ID: 1275311816-31839-5-git-send-email-tiago.vignatti () nokia ! com
[Download RAW message or body]
delete unused namep.
Signed-off-by: Tiago Vignatti <tiago.vignatti@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 0041846..1ea163b 100644
--- a/hw/xfree86/fbdevhw/fbdevhw.c
+++ b/hw/xfree86/fbdevhw/fbdevhw.c
@@ -271,7 +271,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];
@@ -302,14 +302,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);
}
}
@@ -352,16 +347,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;
@@ -431,7 +419,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
_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic