diff options
Diffstat (limited to 'drivers/ata/sata_dwc_460ex.c')
| -rw-r--r-- | drivers/ata/sata_dwc_460ex.c | 26 |
1 files changed, 9 insertions, 17 deletions
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index e3263e961045..7a4f59202156 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c @@ -18,9 +18,8 @@ #include <linux/module.h> #include <linux/device.h> #include <linux/dmaengine.h> -#include <linux/of_address.h> +#include <linux/of.h> #include <linux/of_irq.h> -#include <linux/of_platform.h> #include <linux/platform_device.h> #include <linux/phy/phy.h> #include <linux/libata.h> @@ -42,10 +41,6 @@ #define sata_dwc_writel(a, v) writel_relaxed(v, a) #define sata_dwc_readl(a) readl_relaxed(a) -#ifndef NO_IRQ -#define NO_IRQ 0 -#endif - #define AHB_DMA_BRST_DFLT 64 /* 16 data items burst length */ enum { @@ -242,7 +237,7 @@ static int sata_dwc_dma_init_old(struct platform_device *pdev, /* Get SATA DMA interrupt number */ hsdev->dma->irq = irq_of_parse_and_map(np, 1); - if (hsdev->dma->irq == NO_IRQ) { + if (!hsdev->dma->irq) { dev_err(dev, "no SATA DMA irq\n"); return -ENODEV; } @@ -472,7 +467,7 @@ static irqreturn_t sata_dwc_isr(int irq, void *dev_instance) struct ata_queued_cmd *qc; unsigned long flags; u8 status, tag; - int handled, num_processed, port = 0; + int handled, port = 0; uint intpr, sactive, sactive2, tag_mask; struct sata_dwc_device_port *hsdevp; hsdev->sactive_issued = 0; @@ -618,9 +613,7 @@ DRVSTILLBUSY: dev_dbg(ap->dev, "%s ATA status register=0x%x\n", __func__, status); tag = 0; - num_processed = 0; while (tag_mask) { - num_processed++; while (!(tag_mask & 0x00000001)) { tag++; tag_mask <<= 1; @@ -816,7 +809,7 @@ static int sata_dwc_dma_get_channel(struct sata_dwc_device_port *hsdevp) struct device *dev = hsdev->dev; #ifdef CONFIG_SATA_DWC_OLD_DMA - if (!of_find_property(dev->of_node, "dmas", NULL)) + if (!of_property_present(dev->of_node, "dmas")) return sata_dwc_dma_get_channel_old(hsdevp); #endif @@ -1082,7 +1075,7 @@ static void sata_dwc_dev_select(struct ata_port *ap, unsigned int device) /* * scsi mid-layer and libata interface structures */ -static struct scsi_host_template sata_dwc_sht = { +static const struct scsi_host_template sata_dwc_sht = { ATA_NCQ_SHT(DRV_NAME), /* * test-only: Currently this driver doesn't handle NCQ @@ -1104,7 +1097,7 @@ static struct ata_port_operations sata_dwc_ops = { .inherits = &ata_sff_port_ops, .error_handler = sata_dwc_error_handler, - .hardreset = sata_dwc_hardreset, + .reset.hardreset = sata_dwc_hardreset, .qc_issue = sata_dwc_qc_issue, @@ -1180,13 +1173,13 @@ static int sata_dwc_probe(struct platform_device *ofdev) /* Get SATA interrupt number */ irq = irq_of_parse_and_map(np, 0); - if (irq == NO_IRQ) { + if (!irq) { dev_err(dev, "no SATA DMA irq\n"); return -ENODEV; } #ifdef CONFIG_SATA_DWC_OLD_DMA - if (!of_find_property(np, "dmas", NULL)) { + if (!of_property_present(np, "dmas")) { err = sata_dwc_dma_init_old(ofdev, hsdev); if (err) return err; @@ -1217,7 +1210,7 @@ error_out: return err; } -static int sata_dwc_remove(struct platform_device *ofdev) +static void sata_dwc_remove(struct platform_device *ofdev) { struct device *dev = &ofdev->dev; struct ata_host *host = dev_get_drvdata(dev); @@ -1233,7 +1226,6 @@ static int sata_dwc_remove(struct platform_device *ofdev) #endif dev_dbg(dev, "done\n"); - return 0; } static const struct of_device_id sata_dwc_match[] = { |
