本文整理汇总了C++中ERROR_PRINT函数的典型用法代码示例。如果您正苦于以下问题:C++ ERROR_PRINT函数的具体用法?C++ ERROR_PRINT怎么用?C++ ERROR_PRINT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ERROR_PRINT函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ERROR_PRINT
int zkServer::isLeader()
{
int ret = 0;
int flag = 1;
if(NULL == zkhandle)
{
ERROR_PRINT(" zkhandle is NULL ", "");
return -1;
}
struct String_vector strings;
DEBUG_PRINT("root %s server_name %s count %u", root.c_str(), server_name.c_str(), strings.count);
ret = zoo_get_children(zkhandle, (root+server_name).c_str(), 0, &strings);
if (ret) {
ERROR_PRINT("Error %d for %s", ret, "get_children");
return -1;
}
int i;
for ( i=0; i<strings.count; i++ ) {
DEBUG_PRINT("node_name %s string[%d].data %s", node_name.c_str(), i, strings.data[i]);
if ( strcmp(node_name.c_str(), strings.data[i])>0 ) { /* 如果我自己不是最小的节点 */
flag = 0;
break;
}
}
deallocate_String_vector(&strings);
return flag;
}
开发者ID:bigben0329,项目名称:zk_api_pro,代码行数:29,代码来源:zk_server_api.cpp
示例2: hid_os_force_claim
hid_return hid_os_force_claim(HIDInterface* const hidif, int const interface,
HIDInterfaceMatcher const* const matcher, unsigned short retries UNUSED)
{
if (!hidif) {
ERROR_PRINT("cannot open NULL HIDInterface.");
return HID_RET_INVALID_PARAMETER;
}
if (!hid_is_opened(hidif)) {
ERROR_PRINT("cannot force claim interface of unopened HIDInterface.");
return HID_RET_DEVICE_ALREADY_OPENED;
}
if (!matcher) {
ERROR_PRINT("cannot match against NULL HIDInterfaceMatcher.");
return HID_RET_INVALID_PARAMETER;
}
WARNING_PRINT("code not tested on the Darwin platform!");
TRACE_PRINT("claiming USB device %s...", hidif->id);
#if 1
if (usb_claim_interface(hidif->dev_handle, interface) < 0) {
WARNING_PRINT("failed to claim USB device %s...", hidif->id);
/* return HID_RET_FAIL_CLAIM_IFACE; */
}
#endif
return HID_RET_SUCCESS;
}
开发者ID:mcuee,项目名称:libhid-win,代码行数:28,代码来源:darwin.c
示例3: main
int main ( int argc, const char*argv[] )
{
bool bret;
CSemaphoreMutex sem;
int sec = 3;
int id;
signal(SIGINT,Sighandler);
signal(SIGTERM,Sighandler);
if ( argc < 3 )
{
ERROR_PRINT ( "%s filename key [sec]\n", argv[0] );
exit ( 3 );
}
if ( argc >= 4 )
{
sec = atoi ( argv[3] );
}
id = atoi ( argv[2] );
bret = sem.Create ( argv[1], id );
if ( !bret )
{
ERROR_PRINT ( "can not create %s:%d\n", argv[1], id );
return -2;
}
DEBUG_PRINT("create %s:%d sem\n",argv[1],id);
CliSem ( sem, sec );
DEBUG_PRINT("\n");
sem.Destroy();
return 0;
}
开发者ID:houwentaoff,项目名称:unit_test,代码行数:35,代码来源:semcli.cpp
示例4: SMT113J_SPI_probe
static int SMT113J_SPI_probe(struct platform_device *pdev)
{
int ret;
struct device *SMT113J_SPI_dev;
DEBUG_PRINT("SMT113J_SPI_probe : Start!");
ret = register_chrdev ( NODE_MAJOR, NODE_PATHNAME, &SMT113J_SPI_ctl_fops );
if ( 0 > ret )
{
ERROR_PRINT("SMT113J_SPI_probe : register_chrdev failed : ret = %d!",
ret );
return ( -EFAULT );
}
SMT113J_SPI_class = class_create(THIS_MODULE, NODE_PATHNAME);
if (IS_ERR(SMT113J_SPI_class))
{
ERROR_PRINT("SMT113J_SPI_probe : class_create failed : ret = %d!",
ret );
unregister_chrdev(NODE_MAJOR, NODE_PATHNAME);
class_destroy(SMT113J_SPI_class);
return ( -EFAULT );
}
SMT113J_SPI_dev = device_create ( SMT113J_SPI_class,
NULL,
MKDEV(NODE_MAJOR, NODE_MINOR),
NULL,
NODE_PATHNAME);
if (IS_ERR(SMT113J_SPI_dev))
{
ERROR_PRINT("SMT113J_SPI_probe : device_create failed : ret = %d!",
ret );
unregister_chrdev(NODE_MAJOR, NODE_PATHNAME);
class_destroy(SMT113J_SPI_class);
return ( -EFAULT );
}
ret = spi_register_driver ( &smt113j_spi_driver );
if (ret < 0)
{
ERROR_PRINT(
"SMT113J_SPI_probe : spi_register_driver failed : ret = %d!",
ret );
return ( -EBUSY );
}
smt113j_spi_thread_Init();
DEBUG_PRINT("SMT113J_SPI_probe : End!");
return 0;
}
开发者ID:Adrioid83,项目名称:jflte_xxx,代码行数:60,代码来源:tuner_spi.c
示例5: ERROR_PRINT
bool Game::init() {
if( SDL_Init( SDL_INIT_EVERYTHING ) != 0 ) {
ERROR_PRINT( SDL_GetError() );
return false;
}
SDL_GL_SetAttribute( SDL_GL_CONTEXT_MAJOR_VERSION, 3 );
SDL_GL_SetAttribute( SDL_GL_CONTEXT_MINOR_VERSION, 3 );
SDL_GL_SetAttribute( SDL_GL_CONTEXT_PROFILE_MASK, SDL_GL_CONTEXT_PROFILE_CORE );
m_window = SDL_CreateWindow( "Brick Breaker",
SDL_WINDOWPOS_CENTERED,
SDL_WINDOWPOS_CENTERED,
wWindow,
hWindow,
SDL_WINDOW_SHOWN | SDL_WINDOW_OPENGL
);
if( !m_window ) {
ERROR_PRINT( SDL_GetError() );
return false;
}
if( !SDL_GL_CreateContext( m_window ) ) {
ERROR_PRINT( "Failed creating OpenGL context" );
return false;
}
glewExperimental = GL_TRUE;
GLenum glewError = glewInit();
if( glewError != GL_NO_ERROR ) {
ERROR_PRINT( "Glew init failed" );
return false;
}
// glViewport( 0, 0, wWindow, hWindow );
// if( SDL_GL_SetSwapInterval( -1 ) < 0 ) {
// if( SDL_GL_SetSwapInterval( 1 ) < 0 ) {
// ERROR_PRINT( "Failed to enable VSync" );
// }
// }
if( !m_renderer.init() ) {
ERROR_PRINT( "Renderer failed to init" );
return false;
}
m_runClock.restart();
m_secondsTimer.setLimit( 1.0 );
m_frameCounter = 0;
m_gameState = new LevelState( *this );
m_gameState->init();
return true;
}
开发者ID:Smeky,项目名称:Brick-Breaker,代码行数:59,代码来源:Game.cpp
示例6: access_client_startDaemon
static int
access_client_startDaemon(int cpu_id)
{
/* Check the function of the daemon here */
int res = 0;
char* filepath;
char *newargv[] = { NULL };
char *newenv[] = { NULL };
char *safeexeprog = TOSTRING(ACCESSDAEMON);
char exeprog[1024];
struct sockaddr_un address;
size_t address_length;
int ret;
pid_t pid;
int timeout = 1000;
int socket_fd = -1;
int print_once = 0;
if (config.daemonPath != NULL)
{
strcpy(exeprog, config.daemonPath);
}
else
{
strcpy(exeprog, safeexeprog);
}
if (access(exeprog, X_OK))
{
ERROR_PRINT(Failed to find the daemon '%s'\n, exeprog);
exit(EXIT_FAILURE);
}
DEBUG_PRINT(DEBUGLEV_INFO, Starting daemon %s, exeprog);
pid = fork();
if (pid == 0)
{
if (cpu_id >= 0)
{
cpu_set_t cpuset;
CPU_ZERO(&cpuset);
CPU_SET(cpu_id, &cpuset);
sched_setaffinity(0, sizeof(cpu_set_t), &cpuset);
}
ret = execve (exeprog, newargv, newenv);
if (ret < 0)
{
//ERRNO_PRINT;
ERROR_PRINT(Failed to execute the daemon '%s'\n, exeprog);
exit(EXIT_FAILURE);
}
}
else if (pid < 0)
{
ERROR_PRINT(Failed to fork access daemon for CPU %d, cpu_id);
return pid;
}
开发者ID:rschoene,项目名称:likwid,代码行数:58,代码来源:access_client.c
示例7: robot_open_connection
static void robot_open_connection(robot_t *self)
{
int nb;
int r;
struct sockaddr_in address;
memset(&address, 0, sizeof(address));
address.sin_family = AF_INET;
address.sin_port = htons(g_config.port);
address.sin_addr.s_addr = inet_addr(g_config.ip);
self->socketfd = socket(AF_INET, SOCK_STREAM, 0);
if(self->socketfd == -1)
{
ERROR_PRINT("robot [%d] socket errno [%d], %s.", self->id, errno, strerror(errno));
exit(1);
}
if(setsockopt(self->socketfd, SOL_SOCKET, SO_SNDBUF, &sndbuf, sizeof(sndbuf)) == -1)
{
ERROR_PRINT("robot [%d] setsockopt errno[%d], %s.", self->id, errno, strerror(errno));
exit(1);
}
if(setsockopt(self->socketfd, SOL_SOCKET, SO_RCVBUF, &rcvbuf, sizeof(rcvbuf)) == -1)
{
ERROR_PRINT("robot [%d] setsockopt errno[%d], %s.", self->id, errno, strerror(errno));
exit(1);
}
nb = 1;
if(ioctl(self->socketfd, FIONBIO, &nb) == -1)
{
ERROR_PRINT("robot [%d] ioctl errno[%d], %s.", self->id, errno, strerror(errno));
exit(1);
}
for(;;)
{
r = connect(self->socketfd, (struct sockaddr *)&address, sizeof(address));
if(r == 0)
{
break;
}
if(errno == EINPROGRESS)
{
break;
}
if((errno != EINTR) && (errno != EAGAIN) &&(errno != EWOULDBLOCK))
{
ERROR_PRINT("robot [%d] connect errno [%d], %s", self->id, errno, strerror(errno));
exit(1);
}
usleep(IDLE_TIME_US);
}
}
开发者ID:CuriousBoy0822,项目名称:TSF4G,代码行数:55,代码来源:tconnd_client.c
示例8: SMT113J_SPI_open
static int SMT113J_SPI_open(struct inode *inode, struct file *filp)
{
int ret = 0;
unsigned int majorno = 0,
minorno = 0;
unsigned char *devarea = NULL;
DEBUG_PRINT("SMT113J_SPI_open << Start >>");
majorno = imajor(filp->f_dentry->d_inode);
minorno = iminor(filp->f_dentry->d_inode);
if (( majorno != NODE_MAJOR ) ||
( minorno != NODE_MINOR ))
{
ERROR_PRINT ("SMT113J_SPI_open Error : << No MAJOR(%d) or No MINOR(%d)",
majorno,
minorno );
return ( -ENODEV );
}
/*** Private Data Area MALLOC Stataus Check ***/
if ( NULL != ( devarea = (unsigned char *)filp->private_data ))
{
ERROR_PRINT(
"SMT113J_SPI_open Error : << Used Private Data Area[0x%08x] >>",
(int)devarea );
return ( -ENODEV );
}
/*** Private Data Area Alloc ***/
if ( NULL == ( devarea = (unsigned char *)kmalloc (
sizeof(smt113j_ioctl_data), GFP_KERNEL )))
{
ERROR_PRINT(
"SMT113J_SPI_open Error : << Used Private Data Area Alloc Error");
return ( -ENOMEM ) ;
}
memset ( devarea, 0, sizeof ( smt113j_ioctl_data ));
filp->private_data = (void *)devarea;
/*** buffer clear ***/
memset ( rx_pkt_buffer, 0, MAX_BUFFER_PKT * PAKCET_SIZE );
pwrite = 0;
pread = 0;
spi_open_cnt++;
DEBUG_PRINT("SMT113J_SPI_open << End >>");
return ( ret );
}
开发者ID:Adrioid83,项目名称:jflte_xxx,代码行数:54,代码来源:tuner_spi.c
示例9: prefetcher_init
int prefetcher_init(void)
{
BUG();
L4_KDB_Enter("Implement me");
#if 0
uint64_t source, target;
FILE *pdata;
PEntry *entry;
dprintk(0,"Initializing prefetch cache ");
if( (prefetch_cache = lhmap_create(2097169)) == NULL)
return -1;
/* load prefetch data from file into cache */
if( (pdata=fopen("prefetch.data", "rb")) == NULL)
{
ERROR_PRINT("cannot open prefetch.data");
return -1;
}
while(fscanf(pdata, "%llu -> %llu\n", &source, &target ) != EOF)
{
if(lhmap_lookup(prefetch_cache, source) != NULL)
{
ERROR_PRINT("invalid prefetcher data");
return -1;
}
if( (entry = (PEntry*)qemu_malloc(sizeof(PEntry))) == NULL)
{
ERROR_PRINT("malloc failed");
return -1;
}
entry->next = target;
if( lhmap_insert(prefetch_cache, source, entry))
{
ERROR_PRINT("insert failed");
return -1;
}
}
fclose(pdata);
#endif
dprintk(0,"done.\n");
return 0;
}
开发者ID:B-Rich,项目名称:afterburner,代码行数:53,代码来源:ebc_prefetcher.c
示例10: asciiBoxes_addBox
void
asciiBoxes_addBox(BoxContainer* container, int line, int column, bstring label)
{
if ( line >= container->numLines )
{
ERROR_PRINT(line id %d too large,line);
}
if ( column >= container->numColumns )
{
ERROR_PRINT(column id %d too large,column);
}
container->boxes[line][column].width = 1;
container->boxes[line][column].label = bstrcpy(label);
}
开发者ID:chris-wood,项目名称:cpu-profile,代码行数:15,代码来源:asciiBoxes.c
示例11: serializeState
void serializeState(State *state, char *fileName, int append) {
FILE *fp = NULL;
if (append) {
fp = fopen(fileName, "a");
fprintf(fp, "------------------------------\n");
} else {
fp = fopen(fileName, "w");
}
if (fp == NULL) {
ERROR_PRINT("Couldn't find file: %s", fileName);
exit(1);
}
for (int i = BOARD_DIM-1; i >= 0; i--) {
char line[BOARD_DIM+1];
for (int j = 0; j < BOARD_DIM; j++) {
int point = i*BOARD_DIM+j;
switch (state->board[point]) {
case STATE_WHITE:
line[j] = 'W';
break;
case STATE_BLACK:
line[j] = 'B';
break;
case STATE_EMPTY:
line[j] = '-';
break;
default:
ERROR_PRINT("Unknown character in serializing: %d at point %d", state->board[point], point);
exit(1);
}
}
line[BOARD_DIM] = '\0';
fprintf(fp, "%s\n", line);
}
fprintf(fp, "%c\n", state->turn == STATE_WHITE ? 'W' : 'B');
fprintf(fp, "%d\n", state->whitePrisoners);
fprintf(fp, "%d\n", state->blackPrisoners);
fprintf(fp, "%d\n", state->koPoint);
fprintf(fp, "%d\n", state->blackPassed);
fclose(fp);
}
开发者ID:CurtisHughey,项目名称:ergo,代码行数:48,代码来源:gameParser.c
示例12: hid_prepare_interface
hid_return hid_prepare_interface(HIDInterface* const hidif)
{
hid_return ret;
if (!hid_is_opened(hidif)) {
ERROR_PRINT("cannot prepare unopened HIDinterface.");
return HID_RET_DEVICE_NOT_OPENED;
}
ret = hid_init_parser(hidif);
if (ret != HID_RET_SUCCESS) {
hid_close(hidif);
return ret;
}
ret = hid_prepare_hid_descriptor(hidif);
if (ret != HID_RET_SUCCESS) {
hid_close(hidif);
return ret;
}
ret = hid_prepare_report_descriptor(hidif);
if (ret != HID_RET_SUCCESS) {
hid_close(hidif);
return ret;
}
ret = hid_prepare_parser(hidif);
if (ret != HID_RET_SUCCESS) {
hid_close(hidif);
return ret;
}
return HID_RET_SUCCESS;
}
开发者ID:mcuee,项目名称:libhid-win,代码行数:35,代码来源:hid_preparation.c
示例13: pci_bus_probe
static void
pci_bus_probe (struct pci_info * pci, uint8_t bus)
{
uint8_t dev;
uint8_t dev_found = 0;
struct pci_bus * bus_ptr = NULL;
for (dev = 0; dev < PCI_MAX_DEV; dev++) {
if (pci_get_vendor_id(bus, dev, 0) != 0xffff) {
dev_found = 1;
break;
}
}
if (dev_found) {
bus_ptr = pci_bus_create(bus, pci);
if (!bus_ptr) {
ERROR_PRINT("Could not create PCI bus\n");
return;
}
for (dev = 0; dev < PCI_MAX_DEV; dev++) {
pci_dev_probe(bus_ptr, dev);
}
}
}
开发者ID:haiyang1992,项目名称:NautilusVirtio,代码行数:27,代码来源:pci.c
示例14: SDL_CreateRGBSurface
//------------------------------------------------------------------------
bool platform_support::create_img(unsigned idx, unsigned width, unsigned height)
{
if(idx < max_images)
{
if(m_specific->m_surf_img[idx]) SDL_FreeSurface(m_specific->m_surf_img[idx]);
m_specific->m_surf_img[idx] =
SDL_CreateRGBSurface(SDL_SWSURFACE,
width,
height,
m_specific->m_surface->format->BitsPerPixel,
m_specific->m_rmask,
m_specific->m_gmask,
m_specific->m_bmask,
m_specific->m_amask);
if(m_specific->m_surf_img[idx] == 0)
{
ERROR_PRINT( "Couldn't create image: %s\n", SDL_GetError());
return false;
}
m_rbuf_img[idx].attach((unsigned char*)m_specific->m_surf_img[idx]->pixels,
m_specific->m_surf_img[idx]->w,
m_specific->m_surf_img[idx]->h,
m_flip_y ? -m_specific->m_surf_img[idx]->pitch :
m_specific->m_surf_img[idx]->pitch);
return true;
}
return false;
}
开发者ID:przemekr,项目名称:my_slide,代码行数:34,代码来源:agg_platform_support.cpp
示例15: main
int main(int argc, char **argv)
{
int ret = 0;
if(tapp_sigaction() != E_TLIBC_NOERROR)
{
ret = 1;
ERROR_PRINT("tapp_sigaction(), errno %d.", errno);
goto done;
}
tapp_load_config(&g_config, argc, argv, (tapp_xml_reader_t)tlibc_read_tlogd_config);
if(init() != E_TLIBC_NOERROR)
{
ret = 1;
goto done;
}
if(tapp_loop(TAPP_IDLE_USEC, TAPP_IDLE_LIMIT
, tbusapi_process, &g_tbusapi
, NULL, NULL) != E_TLIBC_NOERROR)
{
ret = 1;
}
fini();
done:
return ret;
}
开发者ID:TracyHu,项目名称:TSF4G,代码行数:30,代码来源:tlogd.c
示例16: partition
void
partition(p_arr arr, p_arr tmp, lint * bin_idx)
{
int N = arr->idx;
int* histogram = (int*) _mm_malloc(sizeof(int)*NUMENTRIESPERTABLE*num_threads, 64);
int* position = (int*) _mm_malloc(sizeof(int)*N, 64);
int right_shift = (int)(log2(g_v_num))-8;
#pragma omp parallel num_threads(num_threads)
{
int i, t;
int threadid = omp_get_thread_num();
int p_per_thread = N/num_threads;
if((p_per_thread * num_threads) != N) p_per_thread++;
int start_n = p_per_thread*threadid;
int end_n = start_n + p_per_thread;
if (end_n > N) end_n = N;
memset(histogram + threadid*NUMENTRIESPERTABLE, 0, sizeof(int)*NUMENTRIESPERTABLE);
for (i = start_n; i < end_n; i++) {
int finalHash = arr->arr[i].int_val1 >> right_shift;
position[i] = histogram[threadid*NUMENTRIESPERTABLE + finalHash];
histogram[threadid*NUMENTRIESPERTABLE + finalHash]++;
}
//__BARRIER__;
TREE_BARRIER(&tree_barrier, threadid, num_threads);
#pragma omp single
{
int current_sum = 0;
int prev_sum = 0;
memset(bin_idx, 0, sizeof(int)*(NUMENTRIESPERTABLE+1));
bin_idx[0] = 0;
for (i = 0; i < NUMENTRIESPERTABLE; i++) {
for (t = 0; t < num_threads; t++) {
//cumsum[i] += histogram[t*NUMENTRIESPERTABLE + i-1];
current_sum = prev_sum + histogram[t*NUMENTRIESPERTABLE + i];
histogram[t*NUMENTRIESPERTABLE + i] = prev_sum;
prev_sum = current_sum;
}
//cumsum[i] += cumsum[i-1];
bin_idx[i+1] = current_sum;
}
if(current_sum != N) ERROR_PRINT();
}
//__BARRIER__;
TREE_BARRIER(&tree_barrier, threadid, num_threads);
for (i = start_n; i < end_n; i++) {
int finalHash = arr->arr[i].int_val1 >> right_shift;
int newIndex = histogram[threadid*NUMENTRIESPERTABLE + finalHash] + position[i];
tmp->arr[newIndex] = arr->arr[i];
}
}
_mm_free(histogram);
_mm_free(position);
}
开发者ID:stplaydog,项目名称:GRAPHBENCH,代码行数:60,代码来源:array.c
示例17: smt113j_spi_probe
static int smt113j_spi_probe(struct spi_device *spi)
{
int ret;
DEBUG_PRINT("smt113j_spi_probe : Start!");
spi->bits_per_word = 8;
spi->mode = SPI_MODE_0;
spi->max_speed_hz = (27 * 1000 * 1000); /* 30MHz */
ret = spi_setup ( spi );
if ( ret < 0 )
{
ERROR_PRINT("smt113j_spi_probe : spi_setup Failed = %d!", ret );
return ( ret );
}
smt113j_spi_device = spi;
wake_lock_init ( &smt113j_spi_wake_lock,
WAKE_LOCK_SUSPEND,
"smt113j_spi_wake_lock" );
DEBUG_PRINT("smt113j_spi_probe : End!");
return ( 0 );
}
开发者ID:Adrioid83,项目名称:jflte_xxx,代码行数:26,代码来源:tuner_spi.c
示例18: main
int main(int argc, char **argv)
{
int ret = 0;
if(tapp_sigaction() != E_TLIBC_NOERROR)
{
ERROR_PRINT("tapp_sigaction failed.");
goto ERROR_RET;
}
tapp_load_config(&g_config, argc, argv, (tapp_xml_reader_t)tlibc_read_tconnd_config);
if(init() != E_TLIBC_NOERROR)
{
goto ERROR_RET;
}
if(tapp_loop(TAPP_IDLE_USEC, TAPP_IDLE_LIMIT
, process, NULL
, NULL, NULL) == E_TLIBC_NOERROR)
{
ret = 0;
}
else
{
ret = 1;
}
fini();
return 0;
ERROR_RET:
return 1;
}
开发者ID:CuriousBoy0822,项目名称:TSF4G,代码行数:34,代码来源:tconnd.c
示例19: objtable_insert
int
objtable_insert(struct memsection *memsection)
{
int cmp;
struct memsection *closest;
if (root == NULL)
{
root = memsection;
}
else
{
closest = find_node(root, objtable_key(memsection), &cmp, NULL);
if (cmp == 0)
{
ERROR_PRINT
(
"Failed to insert object into objtable (ms_base: %" PRIxPTR ")\n",
objtable_key(memsection)
);
return -1; /* Key clash */
}
else if (cmp < 0)
{
closest->left = memsection;
}
else
{
closest->right = memsection;
}
}
return 0;
}
开发者ID:berkus,项目名称:okl4,代码行数:35,代码来源:objtable.c
示例20: SMT113J_SPI_release
static int SMT113J_SPI_release(struct inode *inode, struct file *filp)
{
int ret = 0;
DEBUG_PRINT("SMT113J_SPI_release << Start >>");
/*** Device Open Check ***/
if ( 0 == spi_open_cnt )
{
ERROR_PRINT ("No Open Devices");
return ( ret );
}
spi_open_cnt--;
if ( 0 != spi_open_cnt )
{
ERROR_PRINT ("Not Relase : Open Device Num[%d]", spi_open_cnt );
return ( ret );
}
/*** Private Data Area Check ***/
if ( NULL == (unsigned char *)filp->private_data )
{
ERROR_PRINT("No Private Data");
return ( ret );
}
/*** thread stop ***/
smt113j_spi_thread_Stop();
memset ( (unsigned char *)filp->private_data,
0,
sizeof ( smt113j_ioctl_data ));
kfree ( filp->private_data );
filp->private_data = NULL;
/*** buffer clear ***/
memset ( rx_pkt_buffer, 0, MAX_BUFFER_PKT * PAKCET_SIZE );
pwrite = 0;
pread = 0;
DEBUG_PRINT("SMT113J_SPI_release << End >>");
return ret;
}
开发者ID:Adrioid83,项目名称:jflte_xxx,代码行数:46,代码来源:tuner_spi.c
注:本文中的ERROR_PRINT函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论