Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: rar_register: fix checkpatch errors and debug header file

Signed-off-by: Mark Allyn <mark.a.allyn@intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

authored by

Mark Allyn and committed by
Greg Kroah-Hartman
9cedb392 bafb6f63

+55 -60
+55 -60
drivers/staging/rar_register/rar_register.h
··· 1 - /* === RAR Physical Addresses === */ 2 - struct RAR_address_struct { 3 - u32 low; 4 - u32 high; 1 + /* 2 + * Copyright (C) 2010 Intel Corporation. All rights reserved. 3 + * 4 + * This program is free software; you can redistribute it and/or 5 + * modify it under the terms of version 2 of the GNU General 6 + * Public License as published by the Free Software Foundation. 7 + * 8 + * This program is distributed in the hope that it will be 9 + * useful, but WITHOUT ANY WARRANTY; without even the implied 10 + * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 11 + * PURPOSE. See the GNU General Public License for more details. 12 + * You should have received a copy of the GNU General Public 13 + * License along with this program; if not, write to the Free 14 + * Software Foundation, Inc., 59 Temple Place - Suite 330, 15 + * Boston, MA 02111-1307, USA. 16 + * The full GNU General Public License is included in this 17 + * distribution in the file called COPYING. 18 + */ 19 + 20 + 21 + #ifndef _RAR_REGISTER_H 22 + #define _RAR_REGISTER_H 23 + 24 + # include <linux/types.h> 25 + 26 + /* following are used both in drivers as well as user space apps */ 27 + enum RAR_type { 28 + RAR_TYPE_VIDEO = 0, 29 + RAR_TYPE_AUDIO, 30 + RAR_TYPE_IMAGE, 31 + RAR_TYPE_DATA 5 32 }; 33 + 34 + #ifdef __KERNEL__ 35 + 36 + /* PCI device id for controller */ 37 + #define PCI_RAR_DEVICE_ID 0x4110 38 + 39 + /* The register_rar function is to used by other device drivers 40 + * to ensure that this driver is ready. As we cannot be sure of 41 + * the compile/execute order of dirvers in ther kernel, it is 42 + * best to give this driver a callback function to call when 43 + * it is ready to give out addresses. The callback function 44 + * would have those steps that continue the initialization of 45 + * a driver that do require a valid RAR address. One of those 46 + * steps would be to call get_rar_address() 47 + * This function return 0 on success an -1 on failure. 48 + */ 49 + int register_rar(int (*callback)(void *yourparameter), void *yourparameter); 6 50 7 51 /* The get_rar_address function is used by other device drivers 8 52 * to obtain RAR address information on a RAR. It takes two ··· 63 19 * The function returns a 0 upon success or a -1 if there is no RAR 64 20 * facility on this system. 65 21 */ 66 - int get_rar_address(int rar_index, struct RAR_address_struct *addresses); 22 + int rar_get_address(int rar_index, 23 + dma_addr_t *start_address, 24 + dma_addr_t *end_address); 67 25 68 - 69 - /* The lock_rar function is used by other device drivers to lock an RAR. 26 + /* The lock_rar function is ued by other device drivers to lock an RAR. 70 27 * once an RAR is locked, it stays locked until the next system reboot. 71 28 * The function takes one parameter: 72 29 * ··· 78 33 * The function returns a 0 upon success or a -1 if there is no RAR 79 34 * facility on this system. 80 35 */ 81 - int lock_rar(int rar_index); 36 + int rar_lock(int rar_index); 82 37 83 - 84 - /* DEBUG LEVEL MASKS */ 85 - #define RAR_DEBUG_LEVEL_BASIC 0x1 86 - 87 - #define RAR_DEBUG_LEVEL_REGISTERS 0x2 88 - 89 - #define RAR_DEBUG_LEVEL_EXTENDED 0x4 90 - 91 - #define DEBUG_LEVEL 0x7 92 - 93 - /* FUNCTIONAL MACROS */ 94 - 95 - /* debug macro without paramaters */ 96 - #define DEBUG_PRINT_0(DEBUG_LEVEL , info) \ 97 - do { \ 98 - if (DEBUG_LEVEL) { \ 99 - printk(KERN_WARNING info); \ 100 - } \ 101 - } while (0) 102 - 103 - /* debug macro with 1 paramater */ 104 - #define DEBUG_PRINT_1(DEBUG_LEVEL , info , param1) \ 105 - do { \ 106 - if (DEBUG_LEVEL) { \ 107 - printk(KERN_WARNING info , param1); \ 108 - } \ 109 - } while (0) 110 - 111 - /* debug macro with 2 paramaters */ 112 - #define DEBUG_PRINT_2(DEBUG_LEVEL , info , param1, param2) \ 113 - do { \ 114 - if (DEBUG_LEVEL) { \ 115 - printk(KERN_WARNING info , param1, param2); \ 116 - } \ 117 - } while (0) 118 - 119 - /* debug macro with 3 paramaters */ 120 - #define DEBUG_PRINT_3(DEBUG_LEVEL , info , param1, param2 , param3) \ 121 - do { \ 122 - if (DEBUG_LEVEL) { \ 123 - printk(KERN_WARNING info , param1, param2 , param3); \ 124 - } \ 125 - } while (0) 126 - 127 - /* debug macro with 4 paramaters */ 128 - #define DEBUG_PRINT_4(DEBUG_LEVEL , info , param1, param2 , param3 , param4) \ 129 - do { \ 130 - if (DEBUG_LEVEL) { \ 131 - printk(KERN_WARNING info , param1, param2 , param3 , param4); \ 132 - } \ 133 - } while (0) 134 - 38 + #endif /* __KERNEL__ */ 39 + #endif /* _RAR_REGISTER_H */