Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 29247
b: refs/heads/master
c: 35bb94b
h: refs/heads/master
i:
  29245: cef09c8
  29243: 88ab306
  29239: 7c20129
  29231: 0eee159
  29215: eeb6a0b
  29183: abd2282
v: v3
  • Loading branch information
Jeff Garzik committed Apr 11, 2006
1 parent 7902430 commit cbd4c3d
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 381544bba3ae6f2f1004b267da34f840b469033c
refs/heads/master: 35bb94b116e1fd4959ef0d3187458b5820eac8c4
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/libata-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -4659,7 +4659,7 @@ static struct ata_port * ata_host_add(const struct ata_probe_ent *ent,

host->transportt = &ata_scsi_transport_template;

ap = (struct ata_port *) &host->hostdata[0];
ap = ata_shost_to_port(host);

ata_host_init(ap, host, host_set, ent, port_no);

Expand Down Expand Up @@ -4872,7 +4872,7 @@ void ata_host_set_remove(struct ata_host_set *host_set)

int ata_scsi_release(struct Scsi_Host *host)
{
struct ata_port *ap = (struct ata_port *) &host->hostdata[0];
struct ata_port *ap = ata_shost_to_port(host);
int i;

DPRINTK("ENTER\n");
Expand Down
4 changes: 2 additions & 2 deletions trunk/drivers/scsi/libata-eh.c
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd)
{
struct Scsi_Host *host = cmd->device->host;
struct ata_port *ap = (struct ata_port *) &host->hostdata[0];
struct ata_port *ap = ata_shost_to_port(host);
unsigned long flags;
struct ata_queued_cmd *qc;
enum scsi_eh_timer_return ret = EH_HANDLED;
Expand Down Expand Up @@ -99,7 +99,7 @@ enum scsi_eh_timer_return ata_scsi_timed_out(struct scsi_cmnd *cmd)
*/
void ata_scsi_error(struct Scsi_Host *host)
{
struct ata_port *ap = (struct ata_port *)&host->hostdata[0];
struct ata_port *ap = ata_shost_to_port(host);

DPRINTK("ENTER\n");

Expand Down
8 changes: 4 additions & 4 deletions trunk/drivers/scsi/libata-scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -395,15 +395,15 @@ void ata_dump_status(unsigned id, struct ata_taskfile *tf)

int ata_scsi_device_resume(struct scsi_device *sdev)
{
struct ata_port *ap = (struct ata_port *) &sdev->host->hostdata[0];
struct ata_port *ap = ata_shost_to_port(sdev->host);
struct ata_device *dev = &ap->device[sdev->id];

return ata_device_resume(ap, dev);
}

int ata_scsi_device_suspend(struct scsi_device *sdev, pm_message_t state)
{
struct ata_port *ap = (struct ata_port *) &sdev->host->hostdata[0];
struct ata_port *ap = ata_shost_to_port(sdev->host);
struct ata_device *dev = &ap->device[sdev->id];

return ata_device_suspend(ap, dev, state);
Expand Down Expand Up @@ -704,7 +704,7 @@ int ata_scsi_slave_config(struct scsi_device *sdev)
struct ata_port *ap;
struct ata_device *dev;

ap = (struct ata_port *) &sdev->host->hostdata[0];
ap = ata_shost_to_port(sdev->host);
dev = &ap->device[sdev->id];

ata_scsi_dev_config(sdev, dev);
Expand Down Expand Up @@ -2478,7 +2478,7 @@ int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *))
struct scsi_device *scsidev = cmd->device;
struct Scsi_Host *shost = scsidev->host;

ap = (struct ata_port *) &shost->hostdata[0];
ap = ata_shost_to_port(shost);

spin_unlock(shost->host_lock);
spin_lock(&ap->host_set->lock);
Expand Down
2 changes: 1 addition & 1 deletion trunk/drivers/scsi/sata_svw.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ static int k2_sata_proc_info(struct Scsi_Host *shost, char *page, char **start,
int len, index;

/* Find the ata_port */
ap = (struct ata_port *) &shost->hostdata[0];
ap = ata_shost_to_port(shost);
if (ap == NULL)
return 0;

Expand Down
6 changes: 6 additions & 0 deletions trunk/include/linux/libata.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
#include <asm/io.h>
#include <linux/ata.h>
#include <linux/workqueue.h>
#include <scsi/scsi_host.h>

/*
* compile-time options: to be removed as soon as all the drivers are
Expand Down Expand Up @@ -977,4 +978,9 @@ static inline void ata_pad_free(struct ata_port *ap, struct device *dev)
dma_free_coherent(dev, ATA_DMA_PAD_BUF_SZ, ap->pad, ap->pad_dma);
}

static inline struct ata_port *ata_shost_to_port(struct Scsi_Host *host)
{
return (struct ata_port *) &host->hostdata[0];
}

#endif /* __LINUX_LIBATA_H__ */

0 comments on commit cbd4c3d

Please sign in to comment.