diff options
Diffstat (limited to 'drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c')
-rw-r--r-- | drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c | 52 |
1 files changed, 16 insertions, 36 deletions
diff --git a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c index 4af6527df705..844152cb8dc9 100644 --- a/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c +++ b/drivers/mxc/gpu-viv/hal/os/linux/kernel/gc_hal_kernel_debugfs.c @@ -2,7 +2,7 @@ * * The MIT License (MIT) * -* Copyright (c) 2014 Vivante Corporation +* Copyright (c) 2014 - 2015 Vivante Corporation * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), @@ -26,7 +26,7 @@ * * The GPL License (GPL) * -* Copyright (C) 2014 Vivante Corporation +* Copyright (C) 2014 - 2015 Vivante Corporation * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License @@ -518,28 +518,15 @@ _DebugFSPrint ( ** LINUX SYSTEM FUNCTIONS (START) ** *******************************************************************************/ - -/******************************************************************************* - ** - ** find the vivlog structure associated with an inode. - ** returns a pointer to the structure if found, NULL if not found - ** - *******************************************************************************/ -static gcsDEBUGFS_Node* -_GetNodeInfo ( - IN struct inode *Inode - ) +static int +_DebugFSOpen ( + struct inode* inode, + struct file* filp + ) { - gcsDEBUGFS_Node* node ; + filp->private_data = inode->i_private; - if ( Inode == NULL ) - return NULL ; - - for ( node = gc_dbgfs.linkedlist ; node != NULL ; node = node->next ) - if ( node->filen->d_inode->i_ino == Inode->i_ino ) - return node ; - - return NULL ; + return 0; } /******************************************************************************* @@ -557,13 +544,9 @@ _DebugFSRead ( { int retval ; caddr_t data_to_return ; - gcsDEBUGFS_Node* node ; - /* get the metadata about this emlog */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) - if ( ( node = _GetNodeInfo ( file->f_dentry->d_inode ) ) == NULL ) -#else - if ( ( node = _GetNodeInfo ( file_inode(file) ) ) == NULL ) -#endif + gcsDEBUGFS_Node* node = file->private_data; + + if (node == NULL) { printk ( "debugfs_read: record not found\n" ) ; return - EIO ; @@ -627,14 +610,10 @@ _DebugFSWrite ( { caddr_t message = NULL ; int n ; - gcsDEBUGFS_Node*node ; + gcsDEBUGFS_Node* node = file->private_data; /* get the metadata about this log */ -#if LINUX_VERSION_CODE < KERNEL_VERSION(3,19,0) - if ( ( node = _GetNodeInfo ( file->f_dentry->d_inode ) ) == NULL ) -#else - if ( ( node = _GetNodeInfo ( file_inode(file) ) ) == NULL ) -#endif + if (node == NULL) { return - EIO ; } @@ -902,6 +881,7 @@ vidmem_write( *******************************************************************************/ static const struct file_operations debugfs_operations = { .owner = THIS_MODULE , + .open = _DebugFSOpen , .read = _DebugFSRead , .write = _DebugFSWrite , } ; @@ -1051,7 +1031,7 @@ gckDEBUGFS_CreateNode ( node->temp = NULL; /*creating the file*/ - node->filen = debugfs_create_file(NodeName, S_IRUGO|S_IWUSR, node->parent, NULL, + node->filen = debugfs_create_file(NodeName, S_IRUGO|S_IWUSR, node->parent, node, &debugfs_operations); } |