summaryrefslogtreecommitdiff
path: root/drivers/ata/sata_rcar.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/sata_rcar.c')
-rw-r--r--drivers/ata/sata_rcar.c35
1 files changed, 14 insertions, 21 deletions
diff --git a/drivers/ata/sata_rcar.c b/drivers/ata/sata_rcar.c
index 3d96b6faa3f0..590ebea99601 100644
--- a/drivers/ata/sata_rcar.c
+++ b/drivers/ata/sata_rcar.c
@@ -18,10 +18,6 @@
#define DRV_NAME "sata_rcar"
-/* SH-Navi2G/ATAPI-ATA compatible task registers */
-#define DATA_REG 0x100
-#define SDEVCON_REG 0x138
-
/* SH-Navi2G/ATAPI module compatible control registers */
#define ATAPI_CONTROL1_REG 0x180
#define ATAPI_STATUS_REG 0x184
@@ -283,8 +279,7 @@ static void sata_rcar_dev_select(struct ata_port *ap, unsigned int device)
ata_sff_pause(ap); /* needed; also flushes, for mmio */
}
-static unsigned int sata_rcar_ata_devchk(struct ata_port *ap,
- unsigned int device)
+static bool sata_rcar_ata_devchk(struct ata_port *ap, unsigned int device)
{
struct ata_ioports *ioaddr = &ap->ioaddr;
u8 nsect, lbal;
@@ -304,9 +299,9 @@ static unsigned int sata_rcar_ata_devchk(struct ata_port *ap,
lbal = ioread32(ioaddr->lbal_addr);
if (nsect == 0x55 && lbal == 0xaa)
- return 1; /* found a device */
+ return true; /* found a device */
- return 0; /* nothing found */
+ return false; /* nothing found */
}
static int sata_rcar_wait_after_reset(struct ata_link *link,
@@ -399,8 +394,8 @@ static void sata_rcar_tf_read(struct ata_port *ap, struct ata_taskfile *tf)
{
struct ata_ioports *ioaddr = &ap->ioaddr;
- tf->command = sata_rcar_check_status(ap);
- tf->feature = ioread32(ioaddr->error_addr);
+ tf->status = sata_rcar_check_status(ap);
+ tf->error = ioread32(ioaddr->error_addr);
tf->nsect = ioread32(ioaddr->nsect_addr);
tf->lbal = ioread32(ioaddr->lbal_addr);
tf->lbam = ioread32(ioaddr->lbam_addr);
@@ -857,7 +852,7 @@ static const struct of_device_id sata_rcar_match[] = {
.compatible = "renesas,rcar-gen3-sata",
.data = (void *)RCAR_GEN3_SATA
},
- { },
+ { /* sentinel */ }
};
MODULE_DEVICE_TABLE(of, sata_rcar_match);
@@ -945,19 +940,17 @@ static int sata_rcar_suspend(struct device *dev)
struct ata_host *host = dev_get_drvdata(dev);
struct sata_rcar_priv *priv = host->private_data;
void __iomem *base = priv->base;
- int ret;
- ret = ata_host_suspend(host, PMSG_SUSPEND);
- if (!ret) {
- /* disable interrupts */
- iowrite32(0, base + ATAPI_INT_ENABLE_REG);
- /* mask */
- iowrite32(priv->sataint_mask, base + SATAINTMASK_REG);
+ ata_host_suspend(host, PMSG_SUSPEND);
- pm_runtime_put(dev);
- }
+ /* disable interrupts */
+ iowrite32(0, base + ATAPI_INT_ENABLE_REG);
+ /* mask */
+ iowrite32(priv->sataint_mask, base + SATAINTMASK_REG);
- return ret;
+ pm_runtime_put(dev);
+
+ return 0;
}
static int sata_rcar_resume(struct device *dev)