diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-04 12:30:30 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-04 12:30:30 -0700 |
commit | 84cbd7222b2b00dcddef3103203986b3d59c836a (patch) | |
tree | cdbe55ec410f853d4d532ed3252334cb110d5985 /drivers/scsi/ufs/ufshcd-pltfrm.c | |
parent | 80cc38b16389849a6e06441ace4530f6b2497c3c (diff) | |
parent | a3fda7dd5179989dd0ead820dcebd13f956ddec1 (diff) | |
download | talos-op-linux-84cbd7222b2b00dcddef3103203986b3d59c836a.tar.gz talos-op-linux-84cbd7222b2b00dcddef3103203986b3d59c836a.zip |
Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull first round of SCSI updates from James Bottomley:
"The patch set is mostly driver updates (usf, zfcp, lpfc, mpt2sas,
megaraid_sas, bfa, ipr) and a few bug fixes. Also of note is that the
Buslogic driver has been rewritten to a better coding style and 64 bit
support added. We also removed the libsas limitation on 16 bytes for
the command size (currently no drivers make use of this)"
* tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (101 commits)
[SCSI] megaraid: minor cut and paste error fixed.
[SCSI] ufshcd-pltfrm: remove unnecessary dma_set_coherent_mask() call
[SCSI] ufs: fix register address in UIC error interrupt handling
[SCSI] ufshcd-pltfrm: add missing empty slot in ufs_of_match[]
[SCSI] ufs: use devres functions for ufshcd
[SCSI] ufs: Fix the response UPIU length setting
[SCSI] ufs: rework link start-up process
[SCSI] ufs: remove version check before IS reg clear
[SCSI] ufs: amend interrupt configuration
[SCSI] ufs: wrap the i/o access operations
[SCSI] storvsc: Update the storage protocol to win8 level
[SCSI] storvsc: Increase the value of scsi timeout for storvsc devices
[SCSI] MAINTAINERS: Add myself as the maintainer for BusLogic SCSI driver
[SCSI] BusLogic: Port driver to 64-bit.
[SCSI] BusLogic: Fix style issues
[SCSI] libiscsi: Added new boot entries in the session sysfs
[SCSI] aacraid: Fix for arrays are going offline in the system. System hangs
[SCSI] ipr: IOA Status Code(IOASC) update
[SCSI] sd: Update WRITE SAME heuristics
[SCSI] fnic: potential dead lock in fnic_is_abts_pending()
...
Diffstat (limited to 'drivers/scsi/ufs/ufshcd-pltfrm.c')
-rw-r--r-- | drivers/scsi/ufs/ufshcd-pltfrm.c | 76 |
1 files changed, 19 insertions, 57 deletions
diff --git a/drivers/scsi/ufs/ufshcd-pltfrm.c b/drivers/scsi/ufs/ufshcd-pltfrm.c index 03319acd9c72..c42db40d4e51 100644 --- a/drivers/scsi/ufs/ufshcd-pltfrm.c +++ b/drivers/scsi/ufs/ufshcd-pltfrm.c @@ -33,9 +33,10 @@ * this program. */ -#include "ufshcd.h" #include <linux/platform_device.h> +#include "ufshcd.h" + #ifdef CONFIG_PM /** * ufshcd_pltfrm_suspend - suspend power management function @@ -97,62 +98,39 @@ static int ufshcd_pltfrm_probe(struct platform_device *pdev) struct ufs_hba *hba; void __iomem *mmio_base; struct resource *mem_res; - struct resource *irq_res; - resource_size_t mem_size; - int err; + int irq, err; struct device *dev = &pdev->dev; mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); if (!mem_res) { - dev_err(&pdev->dev, - "Memory resource not available\n"); + dev_err(dev, "Memory resource not available\n"); err = -ENODEV; - goto out_error; - } - - mem_size = resource_size(mem_res); - if (!request_mem_region(mem_res->start, mem_size, "ufshcd")) { - dev_err(&pdev->dev, - "Cannot reserve the memory resource\n"); - err = -EBUSY; - goto out_error; + goto out; } - mmio_base = ioremap_nocache(mem_res->start, mem_size); - if (!mmio_base) { - dev_err(&pdev->dev, "memory map failed\n"); - err = -ENOMEM; - goto out_release_regions; + mmio_base = devm_ioremap_resource(dev, mem_res); + if (IS_ERR(mmio_base)) { + dev_err(dev, "memory map failed\n"); + err = PTR_ERR(mmio_base); + goto out; } - irq_res = platform_get_resource(pdev, IORESOURCE_IRQ, 0); - if (!irq_res) { - dev_err(&pdev->dev, "IRQ resource not available\n"); + irq = platform_get_irq(pdev, 0); + if (irq < 0) { + dev_err(dev, "IRQ resource not available\n"); err = -ENODEV; - goto out_iounmap; - } - - err = dma_set_coherent_mask(dev, dev->coherent_dma_mask); - if (err) { - dev_err(&pdev->dev, "set dma mask failed\n"); - goto out_iounmap; + goto out; } - err = ufshcd_init(&pdev->dev, &hba, mmio_base, irq_res->start); + err = ufshcd_init(dev, &hba, mmio_base, irq); if (err) { - dev_err(&pdev->dev, "Intialization failed\n"); - goto out_iounmap; + dev_err(dev, "Intialization failed\n"); + goto out; } platform_set_drvdata(pdev, hba); - return 0; - -out_iounmap: - iounmap(mmio_base); -out_release_regions: - release_mem_region(mem_res->start, mem_size); -out_error: +out: return err; } @@ -164,32 +142,16 @@ out_error: */ static int ufshcd_pltfrm_remove(struct platform_device *pdev) { - struct resource *mem_res; - resource_size_t mem_size; struct ufs_hba *hba = platform_get_drvdata(pdev); disable_irq(hba->irq); - - /* Some buggy controllers raise interrupt after - * the resources are removed. So first we unregister the - * irq handler and then the resources used by driver - */ - - free_irq(hba->irq, hba); ufshcd_remove(hba); - mem_res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - if (!mem_res) - dev_err(&pdev->dev, "ufshcd: Memory resource not available\n"); - else { - mem_size = resource_size(mem_res); - release_mem_region(mem_res->start, mem_size); - } - platform_set_drvdata(pdev, NULL); return 0; } static const struct of_device_id ufs_of_match[] = { { .compatible = "jedec,ufs-1.1"}, + {}, }; static const struct dev_pm_ops ufshcd_dev_pm_ops = { |