[Linux1394-cvslog] rev 762 - trunk
Brought to you by:
aeb,
bencollins
From: SVN U. <ben...@li...> - 2003-02-02 07:02:00
|
Author: bencollins Date: 2003-02-02 02:01:26 -0500 (Sun, 02 Feb 2003) New Revision: 762 Modified: trunk/ohci1394.c trunk/pcilynx.c Log: Use newer module inc/dec interfaces to get rid of error messages about deprecated functions. Check failure of try_module_get. Modified: trunk/ohci1394.c ============================================================================== --- trunk/ohci1394.c (original) +++ trunk/ohci1394.c 2003-02-02 02:01:27.000000000 -0500 @@ -967,12 +967,13 @@ break; case MODIFY_USAGE: - if (arg) { - MOD_INC_USE_COUNT; - } else { - MOD_DEC_USE_COUNT; - } - retval = 1; + if (arg) { + if (try_module_get(THIS_MODULE)) + retval = 1; + } else { + module_put(THIS_MODULE); + retval = 1; + } break; case ISO_LISTEN_CHANNEL: @@ -1218,7 +1219,7 @@ recv->dma_offset = 0; /* size of DMA program = one descriptor per block */ - if(dma_prog_region_alloc(&recv->prog, + if (dma_prog_region_alloc(&recv->prog, sizeof(struct dma_cmd) * recv->nblocks, recv->ohci->dev)) goto err; @@ -1303,7 +1304,7 @@ /* address of 'branch' field in previous DMA descriptor */ u32 *prev_branch = NULL; - for(blk = 0; blk < recv->nblocks; blk++) { + for (blk = 0; blk < recv->nblocks; blk++) { /* the DMA descriptor */ struct dma_cmd *cmd = &recv->block[blk]; @@ -1313,7 +1314,7 @@ /* offset of this packet's data within the DMA buffer */ unsigned long buf_offset = blk * recv->buf_stride; - if(recv->dma_mode == BUFFER_FILL_MODE) { + if (recv->dma_mode == BUFFER_FILL_MODE) { cmd->control = 2 << 28; /* INPUT_MORE */ } else { cmd->control = 3 << 28; /* INPUT_LAST */ @@ -1322,7 +1323,7 @@ cmd->control |= 8 << 24; /* s = 1, update xferStatus and resCount */ /* interrupt on last block, and at intervals */ - if(blk == recv->nblocks-1 || (blk % recv->block_irq_interval) == 0) { + if (blk == recv->nblocks-1 || (blk % recv->block_irq_interval) == 0) { cmd->control |= 3 << 20; /* want interrupt */ } @@ -1334,7 +1335,7 @@ cmd->status = recv->buf_stride; /* link the previous descriptor to this one */ - if(prev_branch) { + if (prev_branch) { *prev_branch = dma_prog_region_offset_to_bus(&recv->prog, prog_offset); *prev_branch |= 1; /* set Z=1 */ } Modified: trunk/pcilynx.c ============================================================================== --- trunk/pcilynx.c (original) +++ trunk/pcilynx.c 2003-02-02 02:01:27.000000000 -0500 @@ -802,13 +802,14 @@ break; case MODIFY_USAGE: - if (arg) { - MOD_INC_USE_COUNT; - } else { - MOD_DEC_USE_COUNT; - } + if (arg) { + if (try_module_get(THIS_MODULE)) + retval = 1; + } else { + module_put(THIS_MODULE); + retval = 1; + } - retval = 1; break; case ISO_LISTEN_CHANNEL: |