[SCSI] use scmd_id(), scmd_channel() throughout code
[powerpc.git] / drivers / scsi / pcmcia / nsp_cs.c
index 91b3f28..3d2f710 100644 (file)
@@ -51,7 +51,6 @@
 #include <scsi/scsi.h>
 #include <scsi/scsi_ioctl.h>
 
-#include <pcmcia/version.h>
 #include <pcmcia/cs_types.h>
 #include <pcmcia/cs.h>
 #include <pcmcia/cistpl.h>
@@ -202,7 +201,7 @@ static int nsp_queuecommand(Scsi_Cmnd *SCpnt, void (*done)(Scsi_Cmnd *))
 #ifdef NSP_DEBUG
        /*unsigned int host_id = SCpnt->device->host->this_id;*/
        /*unsigned int base    = SCpnt->device->host->io_port;*/
-       unsigned char target = SCpnt->device->id;
+       unsigned char target = scmd_id(SCpnt);
 #endif
        nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
 
@@ -374,7 +373,7 @@ static int nsphw_start_selection(Scsi_Cmnd *SCpnt)
 {
        unsigned int  host_id    = SCpnt->device->host->this_id;
        unsigned int  base       = SCpnt->device->host->io_port;
-       unsigned char target     = SCpnt->device->id;
+       unsigned char target     = scmd_id(SCpnt);
        nsp_hw_data  *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
        int           time_out;
        unsigned char phase, arbit;
@@ -453,7 +452,7 @@ static struct nsp_sync_table nsp_sync_table_20M[] = {
  */
 static int nsp_analyze_sdtr(Scsi_Cmnd *SCpnt)
 {
-       unsigned char          target = SCpnt->device->id;
+       unsigned char          target = scmd_id(SCpnt);
 //     unsigned char          lun    = SCpnt->device->lun;
        nsp_hw_data           *data   = (nsp_hw_data *)SCpnt->device->host->hostdata;
        sync_data             *sync   = &(data->Sync[target]);
@@ -678,7 +677,7 @@ static int nsp_reselected(Scsi_Cmnd *SCpnt)
                target++;
        }
 
-       if (SCpnt->device->id != target) {
+       if (scmd_id(SCpnt) != target) {
                nsp_msg(KERN_ERR, "XXX: reselect ID must be %d in this implementation.", target);
        }
 
@@ -913,7 +912,7 @@ static void nsp_pio_write(Scsi_Cmnd *SCpnt)
 static int nsp_nexus(Scsi_Cmnd *SCpnt)
 {
        unsigned int   base   = SCpnt->device->host->io_port;
-       unsigned char  target = SCpnt->device->id;
+       unsigned char  target = scmd_id(SCpnt);
 //     unsigned char  lun    = SCpnt->device->lun;
        nsp_hw_data *data = (nsp_hw_data *)SCpnt->device->host->hostdata;
        sync_data     *sync   = &(data->Sync[target]);
@@ -1642,11 +1641,6 @@ static dev_link_t *nsp_cs_attach(void)
        link->next               = dev_list;
        dev_list                 = link;
        client_reg.dev_info      = &dev_info;
-       client_reg.EventMask     =
-               CS_EVENT_CARD_INSERTION | CS_EVENT_CARD_REMOVAL |
-               CS_EVENT_RESET_PHYSICAL | CS_EVENT_CARD_RESET   |
-               CS_EVENT_PM_SUSPEND     | CS_EVENT_PM_RESUME     ;
-       client_reg.event_handler = &nsp_cs_event;
        client_reg.Version       = 0x0210;
        client_reg.event_callback_args.client_data = link;
        ret = pcmcia_register_client(&link->handle, &client_reg);
@@ -2138,12 +2132,13 @@ static struct pcmcia_device_id nsp_cs_ids[] = {
 MODULE_DEVICE_TABLE(pcmcia, nsp_cs_ids);
 
 static struct pcmcia_driver nsp_driver = {
-       .owner          = THIS_MODULE,
-       .drv            = {
-               .name   = "nsp_cs",
+       .owner          = THIS_MODULE,
+       .drv            = {
+               .name   = "nsp_cs",
        },
-       .attach         = nsp_cs_attach,
-       .detach         = nsp_cs_detach,
+       .attach         = nsp_cs_attach,
+       .event          = nsp_cs_event,
+       .detach         = nsp_cs_detach,
        .id_table       = nsp_cs_ids,
 };
 #endif