diff options
| author | gdamore <gdamore@NetBSD.org> | 2006-05-11 19:05:41 +0000 |
|---|---|---|
| committer | gdamore <gdamore@NetBSD.org> | 2006-05-11 19:05:41 +0000 |
| commit | 80044be1b4fcf2ca1343ad06fc993dab6310a2df (patch) | |
| tree | 531cb81457d8efccf66da78f8d375ab972fc0a9b /sys/dev/videomode | |
| parent | fc23c7c758f802b1b43e15e06ab11660b71f6f32 (diff) | |
Change edid_parse() to take the edid structure as argument rather than
allocating its own. (This is cleaner since we aren't allocating any
other data in this structure.)
Get rid of edid_free() as a result.
Diffstat (limited to 'sys/dev/videomode')
| -rw-r--r-- | sys/dev/videomode/edid.c | 22 | ||||
| -rw-r--r-- | sys/dev/videomode/edidvar.h | 5 |
2 files changed, 8 insertions, 19 deletions
diff --git a/sys/dev/videomode/edid.c b/sys/dev/videomode/edid.c index 19a6f5a3e6e..a73b4392e01 100644 --- a/sys/dev/videomode/edid.c +++ b/sys/dev/videomode/edid.c @@ -1,4 +1,4 @@ -/* $NetBSD: edid.c,v 1.1 2006/05/11 01:49:53 gdamore Exp $ */ +/* $NetBSD: edid.c,v 1.2 2006/05/11 19:05:41 gdamore Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: edid.c,v 1.1 2006/05/11 01:49:53 gdamore Exp $"); +__KERNEL_RCSID(0, "$NetBSD: edid.c,v 1.2 2006/05/11 19:05:41 gdamore Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -475,22 +475,17 @@ edid_block(struct edid_info *edid, uint8_t *data) /* * Gets EDID version in BCD, e.g. EDID v1.3 returned as 0x0103 */ -struct edid_info * -edid_parse(uint8_t *data) +int +edid_parse(uint8_t *data, struct edid_info *edid) { uint16_t manfid, estmodes; - struct edid_info *edid; const struct videomode *vmp; int i; const char *name; if (edid_is_valid(data) != 0) - return NULL; + return -1; - edid = malloc(sizeof (struct edid_info), M_DEVBUF, M_WAITOK|M_ZERO); - if (edid == NULL) - return NULL; - /* get product identification */ manfid = EDID_VENDOR_ID(data); edid->edid_vendor[0] = EDID_MANFID_0(manfid); @@ -574,11 +569,6 @@ edid_parse(uint8_t *data) edid_strchomp(edid->edid_serial); edid_strchomp(edid->edid_comment); - return edid; + return 0; } -void -edid_free(struct edid_info *edid) -{ - free(edid, M_DEVBUF); -} diff --git a/sys/dev/videomode/edidvar.h b/sys/dev/videomode/edidvar.h index a5f413913de..bfbf01f360e 100644 --- a/sys/dev/videomode/edidvar.h +++ b/sys/dev/videomode/edidvar.h @@ -1,4 +1,4 @@ -/* $NetBSD: edidvar.h,v 1.1 2006/05/11 01:49:53 gdamore Exp $ */ +/* $NetBSD: edidvar.h,v 1.2 2006/05/11 19:05:41 gdamore Exp $ */ /*- * Copyright (c) 2006 Itronix Inc. @@ -88,8 +88,7 @@ struct edid_info { }; int edid_is_valid(uint8_t *); -struct edid_info *edid_parse(uint8_t *); -void edid_free(struct edid_info *); +int edid_parse(uint8_t *, struct edid_info *); void edid_print(struct edid_info *); #endif /* _DEV_VIDEOMODE_EDIDVAR_H */ |
