Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/external/bsd/drm2/include/linux Omit needless firmware h...



details:   https://anonhg.NetBSD.org/src/rev/1d8d0acbe71c
branches:  trunk
changeset: 331244:1d8d0acbe71c
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Aug 06 13:51:12 2014 +0000

description:
Omit needless firmware handle from Linux struct firmware.

diffstat:

 sys/external/bsd/drm2/include/linux/firmware.h |  11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diffs (44 lines):

diff -r 0b1a30f7b41f -r 1d8d0acbe71c sys/external/bsd/drm2/include/linux/firmware.h
--- a/sys/external/bsd/drm2/include/linux/firmware.h    Wed Aug 06 13:50:53 2014 +0000
+++ b/sys/external/bsd/drm2/include/linux/firmware.h    Wed Aug 06 13:51:12 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: firmware.h,v 1.5 2014/07/17 20:56:14 riastradh Exp $   */
+/*     $NetBSD: firmware.h,v 1.6 2014/08/06 13:51:12 riastradh Exp $   */
 
 /*-
  * Copyright (c) 2013 The NetBSD Foundation, Inc.
@@ -42,7 +42,6 @@
 struct device;
 
 struct firmware {
-       firmware_handle_t       fw_h;
        void                    *data;
        size_t                  size;
 };
@@ -53,6 +52,7 @@
 {
        const char *drvname;
        struct firmware *fw;
+       firmware_handle_t handle;
        int ret;
 
        fw = kmem_alloc(sizeof(*fw), KM_SLEEP);
@@ -68,14 +68,15 @@
                image_name += (strlen(drvname) + 1);
 
        /* XXX errno NetBSD->Linux */
-       ret = -firmware_open(drvname, image_name, &fw->fw_h);
+       ret = -firmware_open(drvname, image_name, &handle);
        if (ret)
                goto fail0;
-       fw->size = firmware_get_size(fw->fw_h);
+       fw->size = firmware_get_size(handle);
        fw->data = firmware_malloc(fw->size);
 
        /* XXX errno NetBSD->Linux */
-       ret = -firmware_read(fw->fw_h, 0, fw->data, fw->size);
+       ret = -firmware_read(handle, 0, fw->data, fw->size);
+       (void)firmware_close(handle);
        if (ret)
                goto fail1;
 



Home | Main Index | Thread Index | Old Index