diff options
| author | Andy Shevchenko <andriy.shevchenko@linux.intel.com> | 2015-03-03 15:41:22 -0500 |
|---|---|---|
| committer | Tejun Heo <tj@kernel.org> | 2015-03-24 13:50:35 -0400 |
| commit | db7a657f3c2de202e8d648b03bc25bcd9a4de1d8 (patch) | |
| tree | ebfb9e6b089c345be8a62df1de338f346ece0ee2 /drivers/ata | |
| parent | 8b3444852a2b58129ee68a8dd69fef81ceb902a1 (diff) | |
sata_dwc_460ex: re-use hsdev->dev instead of dwc_dev
This patch re-uses hsdev->dev which is allocated on heap. Therefore, the
private structure, which is global variable, is reduced by one field.
In one case ap->dev is used and there it seems to be right decision.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
Diffstat (limited to 'drivers/ata')
| -rw-r--r-- | drivers/ata/sata_dwc_460ex.c | 23 |
1 files changed, 11 insertions, 12 deletions
diff --git a/drivers/ata/sata_dwc_460ex.c b/drivers/ata/sata_dwc_460ex.c index 08cd63fae7ef..5ab484992a4b 100644 --- a/drivers/ata/sata_dwc_460ex.c +++ b/drivers/ata/sata_dwc_460ex.c | |||
| @@ -194,7 +194,6 @@ struct sata_dwc_host_priv { | |||
| 194 | void __iomem *scr_addr_sstatus; | 194 | void __iomem *scr_addr_sstatus; |
| 195 | u32 sata_dwc_sactive_issued ; | 195 | u32 sata_dwc_sactive_issued ; |
| 196 | u32 sata_dwc_sactive_queued ; | 196 | u32 sata_dwc_sactive_queued ; |
| 197 | struct device *dwc_dev; | ||
| 198 | }; | 197 | }; |
| 199 | 198 | ||
| 200 | static struct sata_dwc_host_priv host_pvt; | 199 | static struct sata_dwc_host_priv host_pvt; |
| @@ -252,16 +251,16 @@ static const char *get_dma_dir_descript(int dma_dir) | |||
| 252 | } | 251 | } |
| 253 | } | 252 | } |
| 254 | 253 | ||
| 255 | static void sata_dwc_tf_dump(struct ata_taskfile *tf) | 254 | static void sata_dwc_tf_dump(struct ata_port *ap, struct ata_taskfile *tf) |
| 256 | { | 255 | { |
| 257 | dev_vdbg(host_pvt.dwc_dev, | 256 | dev_vdbg(ap->dev, |
| 258 | "taskfile cmd: 0x%02x protocol: %s flags: 0x%lx device: %x\n", | 257 | "taskfile cmd: 0x%02x protocol: %s flags: 0x%lx device: %x\n", |
| 259 | tf->command, get_prot_descript(tf->protocol), tf->flags, | 258 | tf->command, get_prot_descript(tf->protocol), tf->flags, |
| 260 | tf->device); | 259 | tf->device); |
| 261 | dev_vdbg(host_pvt.dwc_dev, | 260 | dev_vdbg(ap->dev, |
| 262 | "feature: 0x%02x nsect: 0x%x lbal: 0x%x lbam: 0x%x lbah: 0x%x\n", | 261 | "feature: 0x%02x nsect: 0x%x lbal: 0x%x lbam: 0x%x lbah: 0x%x\n", |
| 263 | tf->feature, tf->nsect, tf->lbal, tf->lbam, tf->lbah); | 262 | tf->feature, tf->nsect, tf->lbal, tf->lbam, tf->lbah); |
| 264 | dev_vdbg(host_pvt.dwc_dev, | 263 | dev_vdbg(ap->dev, |
| 265 | "hob_feature: 0x%02x hob_nsect: 0x%x hob_lbal: 0x%x hob_lbam: 0x%x hob_lbah: 0x%x\n", | 264 | "hob_feature: 0x%02x hob_nsect: 0x%x hob_lbal: 0x%x hob_lbam: 0x%x hob_lbah: 0x%x\n", |
| 266 | tf->hob_feature, tf->hob_nsect, tf->hob_lbal, tf->hob_lbam, | 265 | tf->hob_feature, tf->hob_nsect, tf->hob_lbal, tf->hob_lbam, |
| 267 | tf->hob_lbah); | 266 | tf->hob_lbah); |
| @@ -337,7 +336,7 @@ static struct dma_async_tx_descriptor *dma_dwc_xfer_setup(struct ata_queued_cmd | |||
| 337 | desc->callback = dma_dwc_xfer_done; | 336 | desc->callback = dma_dwc_xfer_done; |
| 338 | desc->callback_param = hsdev; | 337 | desc->callback_param = hsdev; |
| 339 | 338 | ||
| 340 | dev_dbg(host_pvt.dwc_dev, "%s sg: 0x%p, count: %d addr: %pad\n", | 339 | dev_dbg(hsdev->dev, "%s sg: 0x%p, count: %d addr: %pad\n", |
| 341 | __func__, qc->sg, qc->n_elem, &addr); | 340 | __func__, qc->sg, qc->n_elem, &addr); |
| 342 | 341 | ||
| 343 | return desc; | 342 | return desc; |
| @@ -687,7 +686,7 @@ static void sata_dwc_clear_dmacr(struct sata_dwc_device_port *hsdevp, u8 tag) | |||
| 687 | * This should not happen, it indicates the driver is out of | 686 | * This should not happen, it indicates the driver is out of |
| 688 | * sync. If it does happen, clear dmacr anyway. | 687 | * sync. If it does happen, clear dmacr anyway. |
| 689 | */ | 688 | */ |
| 690 | dev_err(host_pvt.dwc_dev, | 689 | dev_err(hsdev->dev, |
| 691 | "%s DMA protocol RX and TX DMA not pending tag=0x%02x pending=%d dmacr: 0x%08x\n", | 690 | "%s DMA protocol RX and TX DMA not pending tag=0x%02x pending=%d dmacr: 0x%08x\n", |
| 692 | __func__, tag, hsdevp->dma_pending[tag], | 691 | __func__, tag, hsdevp->dma_pending[tag], |
| 693 | in_le32(&hsdev->sata_dwc_regs->dmacr)); | 692 | in_le32(&hsdev->sata_dwc_regs->dmacr)); |
| @@ -779,7 +778,7 @@ static void sata_dwc_enable_interrupts(struct sata_dwc_device *hsdev) | |||
| 779 | */ | 778 | */ |
| 780 | out_le32(&hsdev->sata_dwc_regs->errmr, SATA_DWC_SERROR_ERR_BITS); | 779 | out_le32(&hsdev->sata_dwc_regs->errmr, SATA_DWC_SERROR_ERR_BITS); |
| 781 | 780 | ||
| 782 | dev_dbg(host_pvt.dwc_dev, "%s: INTMR = 0x%08x, ERRMR = 0x%08x\n", | 781 | dev_dbg(hsdev->dev, "%s: INTMR = 0x%08x, ERRMR = 0x%08x\n", |
| 783 | __func__, in_le32(&hsdev->sata_dwc_regs->intmr), | 782 | __func__, in_le32(&hsdev->sata_dwc_regs->intmr), |
| 784 | in_le32(&hsdev->sata_dwc_regs->errmr)); | 783 | in_le32(&hsdev->sata_dwc_regs->errmr)); |
| 785 | } | 784 | } |
| @@ -855,7 +854,7 @@ static int sata_dwc_port_start(struct ata_port *ap) | |||
| 855 | hsdevp->hsdev = hsdev; | 854 | hsdevp->hsdev = hsdev; |
| 856 | 855 | ||
| 857 | hsdevp->dws = &sata_dwc_dma_dws; | 856 | hsdevp->dws = &sata_dwc_dma_dws; |
| 858 | hsdevp->dws->dma_dev = host_pvt.dwc_dev; | 857 | hsdevp->dws->dma_dev = hsdev->dev; |
| 859 | 858 | ||
| 860 | dma_cap_zero(mask); | 859 | dma_cap_zero(mask); |
| 861 | dma_cap_set(DMA_SLAVE, mask); | 860 | dma_cap_set(DMA_SLAVE, mask); |
| @@ -863,7 +862,7 @@ static int sata_dwc_port_start(struct ata_port *ap) | |||
| 863 | /* Acquire DMA channel */ | 862 | /* Acquire DMA channel */ |
| 864 | hsdevp->chan = dma_request_channel(mask, sata_dwc_dma_filter, hsdevp); | 863 | hsdevp->chan = dma_request_channel(mask, sata_dwc_dma_filter, hsdevp); |
| 865 | if (!hsdevp->chan) { | 864 | if (!hsdevp->chan) { |
| 866 | dev_err(host_pvt.dwc_dev, "%s: dma channel unavailable\n", | 865 | dev_err(hsdev->dev, "%s: dma channel unavailable\n", |
| 867 | __func__); | 866 | __func__); |
| 868 | err = -EAGAIN; | 867 | err = -EAGAIN; |
| 869 | goto CLEANUP_ALLOC; | 868 | goto CLEANUP_ALLOC; |
| @@ -990,7 +989,7 @@ static void sata_dwc_bmdma_start_by_tag(struct ata_queued_cmd *qc, u8 tag) | |||
| 990 | "%s qc=%p tag: %x cmd: 0x%02x dma_dir: %s start_dma? %x\n", | 989 | "%s qc=%p tag: %x cmd: 0x%02x dma_dir: %s start_dma? %x\n", |
| 991 | __func__, qc, tag, qc->tf.command, | 990 | __func__, qc, tag, qc->tf.command, |
| 992 | get_dma_dir_descript(qc->dma_dir), start_dma); | 991 | get_dma_dir_descript(qc->dma_dir), start_dma); |
| 993 | sata_dwc_tf_dump(&(qc->tf)); | 992 | sata_dwc_tf_dump(ap, &qc->tf); |
| 994 | 993 | ||
| 995 | if (start_dma) { | 994 | if (start_dma) { |
| 996 | reg = core_scr_read(SCR_ERROR); | 995 | reg = core_scr_read(SCR_ERROR); |
| @@ -1244,7 +1243,7 @@ static int sata_dwc_probe(struct platform_device *ofdev) | |||
| 1244 | } | 1243 | } |
| 1245 | 1244 | ||
| 1246 | /* Save dev for later use in dev_xxx() routines */ | 1245 | /* Save dev for later use in dev_xxx() routines */ |
| 1247 | host_pvt.dwc_dev = &ofdev->dev; | 1246 | hsdev->dev = &ofdev->dev; |
| 1248 | 1247 | ||
| 1249 | hsdev->dma->dev = &ofdev->dev; | 1248 | hsdev->dma->dev = &ofdev->dev; |
| 1250 | 1249 | ||
