Loading drivers/scsi/ufs/ufshcd-pci.c +2 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ static void ufshcd_pci_remove(struct pci_dev *pdev) pm_runtime_forbid(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); ufshcd_remove(hba); ufshcd_dealloc_host(hba); pci_set_drvdata(pdev, NULL); } Loading Loading @@ -151,6 +152,7 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) err = ufshcd_init(hba, mmio_base, pdev->irq); if (err) { dev_err(&pdev->dev, "Initialization failed\n"); ufshcd_dealloc_host(hba); return err; } Loading drivers/scsi/ufs/ufshcd-pltfrm.c +9 −11 Original line number Diff line number Diff line Loading @@ -111,19 +111,19 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba) if (ret && (ret != -EINVAL)) { dev_err(dev, "%s: error reading array %d\n", "freq-table-hz", ret); goto free_clkfreq; goto out; } for (i = 0; i < sz; i += 2) { ret = of_property_read_string_index(np, "clock-names", i/2, (const char **)&name); if (ret) goto free_clkfreq; goto out; clki = devm_kzalloc(dev, sizeof(*clki), GFP_KERNEL); if (!clki) { ret = -ENOMEM; goto free_clkfreq; goto out; } clki->min_freq = clkfreq[i]; Loading @@ -133,8 +133,6 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba) clki->min_freq, clki->max_freq, clki->name); list_add_tail(&clki->list, &hba->clk_list_head); } free_clkfreq: kfree(clkfreq); out: return ret; } Loading Loading @@ -173,7 +171,7 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name, if (ret) { dev_err(dev, "%s: unable to find %s err %d\n", __func__, prop_name, ret); goto out_free; goto out; } vreg->min_uA = 0; Loading @@ -195,9 +193,6 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name, goto out; out_free: devm_kfree(dev, vreg); vreg = NULL; out: if (!ret) *out_vreg = vreg; Loading Loading @@ -325,13 +320,13 @@ static int ufshcd_pltfrm_probe(struct platform_device *pdev) if (err) { dev_err(&pdev->dev, "%s: clock parse failed %d\n", __func__, err); goto out; goto dealloc_host; } err = ufshcd_parse_regulator_info(hba); if (err) { dev_err(&pdev->dev, "%s: regulator init failed %d\n", __func__, err); goto out; goto dealloc_host; } pm_runtime_set_active(&pdev->dev); Loading @@ -353,6 +348,8 @@ static int ufshcd_pltfrm_probe(struct platform_device *pdev) out_disable_rpm: pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); dealloc_host: ufshcd_dealloc_host(hba); out: return err; } Loading @@ -369,6 +366,7 @@ static int ufshcd_pltfrm_remove(struct platform_device *pdev) pm_runtime_get_sync(&(pdev)->dev); ufshcd_remove(hba); ufshcd_dealloc_host(hba); return 0; } Loading drivers/scsi/ufs/ufshcd.c +10 −3 Original line number Diff line number Diff line Loading @@ -5751,8 +5751,6 @@ void ufshcd_remove(struct ufs_hba *hba) ufshcd_disable_intr(hba, hba->intr_mask); ufshcd_hba_stop(hba, true); scsi_host_put(hba->host); ufshcd_exit_clk_gating(hba); if (ufshcd_is_clkscaling_enabled(hba)) devfreq_remove_device(hba->devfreq); Loading Loading @@ -5796,6 +5794,16 @@ out_error: } EXPORT_SYMBOL(ufshcd_alloc_host); /** * ufshcd_dealloc_host - deallocate Host Bus Adapter (HBA) * @hba: pointer to Host Bus Adapter (HBA) */ void ufshcd_dealloc_host(struct ufs_hba *hba) { scsi_host_put(hba->host); } EXPORT_SYMBOL(ufshcd_dealloc_host); /** * ufshcd_set_dma_mask - Set dma mask based on the controller * addressing capability Loading Loading @@ -6096,7 +6104,6 @@ exit_gating: ufshcd_exit_clk_gating(hba); out_disable: hba->is_irq_enabled = false; scsi_host_put(host); UFSDBG_REMOVE_DEBUGFS(hba) ufshcd_hba_exit(hba); out_error: Loading drivers/scsi/ufs/ufshcd.h +1 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,7 @@ static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg) } int ufshcd_alloc_host(struct device *, struct ufs_hba **); void ufshcd_dealloc_host(struct ufs_hba *); int ufshcd_init(struct ufs_hba * , void __iomem * , unsigned int); void ufshcd_remove(struct ufs_hba *); int ufshcd_wait_for_register(struct ufs_hba *hba, u32 reg, u32 mask, Loading Loading
drivers/scsi/ufs/ufshcd-pci.c +2 −0 Original line number Diff line number Diff line Loading @@ -107,6 +107,7 @@ static void ufshcd_pci_remove(struct pci_dev *pdev) pm_runtime_forbid(&pdev->dev); pm_runtime_get_noresume(&pdev->dev); ufshcd_remove(hba); ufshcd_dealloc_host(hba); pci_set_drvdata(pdev, NULL); } Loading Loading @@ -151,6 +152,7 @@ ufshcd_pci_probe(struct pci_dev *pdev, const struct pci_device_id *id) err = ufshcd_init(hba, mmio_base, pdev->irq); if (err) { dev_err(&pdev->dev, "Initialization failed\n"); ufshcd_dealloc_host(hba); return err; } Loading
drivers/scsi/ufs/ufshcd-pltfrm.c +9 −11 Original line number Diff line number Diff line Loading @@ -111,19 +111,19 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba) if (ret && (ret != -EINVAL)) { dev_err(dev, "%s: error reading array %d\n", "freq-table-hz", ret); goto free_clkfreq; goto out; } for (i = 0; i < sz; i += 2) { ret = of_property_read_string_index(np, "clock-names", i/2, (const char **)&name); if (ret) goto free_clkfreq; goto out; clki = devm_kzalloc(dev, sizeof(*clki), GFP_KERNEL); if (!clki) { ret = -ENOMEM; goto free_clkfreq; goto out; } clki->min_freq = clkfreq[i]; Loading @@ -133,8 +133,6 @@ static int ufshcd_parse_clock_info(struct ufs_hba *hba) clki->min_freq, clki->max_freq, clki->name); list_add_tail(&clki->list, &hba->clk_list_head); } free_clkfreq: kfree(clkfreq); out: return ret; } Loading Loading @@ -173,7 +171,7 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name, if (ret) { dev_err(dev, "%s: unable to find %s err %d\n", __func__, prop_name, ret); goto out_free; goto out; } vreg->min_uA = 0; Loading @@ -195,9 +193,6 @@ static int ufshcd_populate_vreg(struct device *dev, const char *name, goto out; out_free: devm_kfree(dev, vreg); vreg = NULL; out: if (!ret) *out_vreg = vreg; Loading Loading @@ -325,13 +320,13 @@ static int ufshcd_pltfrm_probe(struct platform_device *pdev) if (err) { dev_err(&pdev->dev, "%s: clock parse failed %d\n", __func__, err); goto out; goto dealloc_host; } err = ufshcd_parse_regulator_info(hba); if (err) { dev_err(&pdev->dev, "%s: regulator init failed %d\n", __func__, err); goto out; goto dealloc_host; } pm_runtime_set_active(&pdev->dev); Loading @@ -353,6 +348,8 @@ static int ufshcd_pltfrm_probe(struct platform_device *pdev) out_disable_rpm: pm_runtime_disable(&pdev->dev); pm_runtime_set_suspended(&pdev->dev); dealloc_host: ufshcd_dealloc_host(hba); out: return err; } Loading @@ -369,6 +366,7 @@ static int ufshcd_pltfrm_remove(struct platform_device *pdev) pm_runtime_get_sync(&(pdev)->dev); ufshcd_remove(hba); ufshcd_dealloc_host(hba); return 0; } Loading
drivers/scsi/ufs/ufshcd.c +10 −3 Original line number Diff line number Diff line Loading @@ -5751,8 +5751,6 @@ void ufshcd_remove(struct ufs_hba *hba) ufshcd_disable_intr(hba, hba->intr_mask); ufshcd_hba_stop(hba, true); scsi_host_put(hba->host); ufshcd_exit_clk_gating(hba); if (ufshcd_is_clkscaling_enabled(hba)) devfreq_remove_device(hba->devfreq); Loading Loading @@ -5796,6 +5794,16 @@ out_error: } EXPORT_SYMBOL(ufshcd_alloc_host); /** * ufshcd_dealloc_host - deallocate Host Bus Adapter (HBA) * @hba: pointer to Host Bus Adapter (HBA) */ void ufshcd_dealloc_host(struct ufs_hba *hba) { scsi_host_put(hba->host); } EXPORT_SYMBOL(ufshcd_dealloc_host); /** * ufshcd_set_dma_mask - Set dma mask based on the controller * addressing capability Loading Loading @@ -6096,7 +6104,6 @@ exit_gating: ufshcd_exit_clk_gating(hba); out_disable: hba->is_irq_enabled = false; scsi_host_put(host); UFSDBG_REMOVE_DEBUGFS(hba) ufshcd_hba_exit(hba); out_error: Loading
drivers/scsi/ufs/ufshcd.h +1 −0 Original line number Diff line number Diff line Loading @@ -598,6 +598,7 @@ static inline void ufshcd_rmwl(struct ufs_hba *hba, u32 mask, u32 val, u32 reg) } int ufshcd_alloc_host(struct device *, struct ufs_hba **); void ufshcd_dealloc_host(struct ufs_hba *); int ufshcd_init(struct ufs_hba * , void __iomem * , unsigned int); void ufshcd_remove(struct ufs_hba *); int ufshcd_wait_for_register(struct ufs_hba *hba, u32 reg, u32 mask, Loading