kernels/linux-2.4.0/drivers/scsi/ips.c
/****************************************************************************/
/*                                                                          */
/* Routine Name: ips_free                                                   */
/*                                                                          */
/* Routine Description:                                                     */
/*                                                                          */
/*   Free any allocated space for this controller                           */
/*                                                                          */
/****************************************************************************/


Routine Description.

Free any allocated space for this controller
Routine Description . Free any allocated space for this controller
static void
ips_free(ips_ha_t *ha) {
   int i;
   METHOD_TRACE("ips_free", 1);
   if (ha) {
      if (ha->enq) {
         kfree(ha->enq);
         ha->enq = NULL;
      }
      if (ha->conf) {
         kfree(ha->conf);
         ha->conf = NULL;
      }
      if (ha->adapt) {
         kfree(ha->adapt);
         ha->adapt = NULL;
      }
      if (ha->nvram) {
         kfree(ha->nvram);
         ha->nvram = NULL;
      }
      if (ha->subsys) {
         kfree(ha->subsys);
         ha->subsys = NULL;
      }
      if (ha->dummy) {
         kfree(ha->dummy);
         ha->dummy = NULL;
      }
      if (ha->ioctl_data) {
         kfree(ha->ioctl_data);
         ha->ioctl_data = NULL;
         ha->ioctl_datasize = 0;
      }
      if (ha->scbs) {
         for (i = 0; i < ha->max_cmds; i++) {
            if (ha->scbs[i].sg_list)
               kfree(ha->scbs[i].sg_list);
         }
         kfree(ha->scbs);
         ha->scbs = NULL;
      } 
      if (ha->mem_ptr) {
         iounmap(ha->ioremap_ptr);
         ha->ioremap_ptr = NULL;
         ha->mem_ptr = NULL;
         ha->mem_addr = 0;
      }
   }
}
static void ips_free ( ips_ha_t * ha ) { int i ; METHOD_TRACE ( " " , 1 ) ; if ( ha ) { if ( ha -> enq ) { kfree ( ha -> enq ) ; ha -> enq = NULL ; } if ( ha -> conf ) { kfree ( ha -> conf ) ; ha -> conf = NULL ; } if ( ha -> adapt ) { kfree ( ha -> adapt ) ; ha -> adapt = NULL ; } if ( ha -> nvram ) { kfree ( ha -> nvram ) ; ha -> nvram = NULL ; } if ( ha -> subsys ) { kfree ( ha -> subsys ) ; ha -> subsys = NULL ; } if ( ha -> dummy ) { kfree ( ha -> dummy ) ; ha -> dummy = NULL ; } if ( ha -> ioctl_data ) { kfree ( ha -> ioctl_data ) ; ha -> ioctl_data = NULL ; ha -> ioctl_datasize = 0 ; } if ( ha -> scbs ) { for ( i = 0 ; i < ha -> max_cmds ; i ++ ) { if ( ha -> scbs [ i ] . sg_list ) kfree ( ha -> scbs [ i ] . sg_list ) ; } kfree ( ha -> scbs ) ; ha -> scbs = NULL ; } if ( ha -> mem_ptr ) { iounmap ( ha -> ioremap_ptr ) ; ha -> ioremap_ptr = NULL ; ha -> mem_ptr = NULL ; ha -> mem_addr = 0 ; } } }
Routine Name: ips_free
Routine Name : ips_free
/* end if */ /* free memory mapped (if applicable) */