static int dwc3_of_simple_remove(struct platform_device *pdev) { struct dwc3_of_simple *simple = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; int i; of_platform_depopulate(dev); for (i = 0; i < simple->num_clocks; i++) { clk_disable_unprepare(simple->clks[i]); clk_put(simple->clks[i]); } simple->num_clocks = 0; if (!simple->pulse_resets) reset_control_assert(simple->resets); reset_control_put(simple->resets); pm_runtime_disable(dev); pm_runtime_put_noidle(dev); pm_runtime_set_suspended(dev); return 0; }
static int st_dwc3_remove(struct platform_device *pdev) { struct st_dwc3 *dwc3_data = platform_get_drvdata(pdev); of_platform_depopulate(&pdev->dev); reset_control_assert(dwc3_data->rstc_pwrdn); reset_control_assert(dwc3_data->rstc_rst); return 0; }
static int dwc3_omap_remove(struct platform_device *pdev) { struct dwc3_omap *omap = platform_get_drvdata(pdev); dwc3_omap_disable_irqs(omap); disable_irq(omap->irq); of_platform_depopulate(omap->dev); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; }
static int dwc3_omap_remove(struct platform_device *pdev) { struct dwc3_omap *omap = platform_get_drvdata(pdev); extcon_unregister_notifier(omap->edev, EXTCON_USB, &omap->vbus_nb); extcon_unregister_notifier(omap->edev, EXTCON_USB_HOST, &omap->id_nb); dwc3_omap_disable_irqs(omap); of_platform_depopulate(omap->dev); pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); return 0; }
static int disp_manager_dev_probe(struct platform_device *pdev) { struct display_manager *disp_m; int rc = 0; if (!pdev || !pdev->dev.of_node) { pr_err("pdev not found\n"); return -ENODEV; } disp_m = devm_kzalloc(&pdev->dev, sizeof(*disp_m), GFP_KERNEL); if (!disp_m) return -ENOMEM; disp_m->name = "qcom,display-manager"; of_platform_populate(pdev->dev.of_node, displays_dt_match, NULL, &pdev->dev); disp_m->display_count = _dm_cache_active_displays(disp_m); if (!disp_m->display_count) { rc = -ENODEV; pr_err("no displays found, rc=%d\n", rc); goto error_free_disp_m; } rc = _dm_init_active_displays(disp_m); if (rc) { pr_err("failed to initialize displays, rc=%d\n", rc); goto error_remove_displays; } rc = component_add(&pdev->dev, &disp_manager_comp_ops); if (rc) { pr_err("failed to add component, rc=%d\n", rc); goto error_deinit_displays; } mutex_init(&disp_m->lock); platform_set_drvdata(pdev, disp_m); return rc; error_deinit_displays: _dm_deinit_active_displays(disp_m); error_remove_displays: of_platform_depopulate(&pdev->dev); error_free_disp_m: devm_kfree(&pdev->dev, disp_m); return rc; }
static int scpi_remove(struct platform_device *pdev) { struct device *dev = &pdev->dev; struct scpi_drvinfo *scpi_info = platform_get_drvdata(pdev); of_platform_depopulate(dev); sysfs_remove_groups(&dev->kobj, versions_groups); scpi_free_channels(dev, scpi_info->channels, scpi_info->num_chans); platform_set_drvdata(pdev, NULL); devm_kfree(dev, scpi_info->channels); devm_kfree(dev, scpi_info); scpi_info = NULL; return 0; }
static int disp_manager_dev_remove(struct platform_device *pdev) { struct display_manager *disp_m; if (!pdev) { pr_err("invalid pdev argument\n"); return -ENODEV; } disp_m = platform_get_drvdata(pdev); _dm_deinit_active_displays(disp_m); of_platform_depopulate(&pdev->dev); devm_kfree(&pdev->dev, disp_m); return 0; }
static int dwc3_of_simple_remove(struct platform_device *pdev) { struct dwc3_of_simple *simple = platform_get_drvdata(pdev); struct device *dev = &pdev->dev; int i; for (i = 0; i < simple->num_clocks; i++) { clk_unprepare(simple->clks[i]); clk_put(simple->clks[i]); } of_platform_depopulate(dev); pm_runtime_put_sync(dev); pm_runtime_disable(dev); return 0; }
static int caam_remove(struct platform_device *pdev) { struct device *ctrldev; struct caam_drv_private *ctrlpriv; struct caam_ctrl __iomem *ctrl; ctrldev = &pdev->dev; ctrlpriv = dev_get_drvdata(ctrldev); ctrl = (struct caam_ctrl __iomem *)ctrlpriv->ctrl; /* Remove platform devices under the crypto node */ of_platform_depopulate(ctrldev); #ifdef CONFIG_CAAM_QI if (ctrlpriv->qidev) caam_qi_shutdown(ctrlpriv->qidev); #endif /* * De-initialize RNG state handles initialized by this driver. * In case of SoCs with Management Complex, RNG is managed by MC f/w. */ if (!ctrlpriv->mc_en && ctrlpriv->rng4_sh_init) deinstantiate_rng(ctrldev, ctrlpriv->rng4_sh_init); /* Shut down debug views */ #ifdef CONFIG_DEBUG_FS debugfs_remove_recursive(ctrlpriv->dfs_root); #endif /* Unmap controller region */ iounmap(ctrl); /* shut clocks off before finalizing shutdown */ clk_disable_unprepare(ctrlpriv->caam_ipg); if (ctrlpriv->caam_mem) clk_disable_unprepare(ctrlpriv->caam_mem); clk_disable_unprepare(ctrlpriv->caam_aclk); if (ctrlpriv->caam_emi_slow) clk_disable_unprepare(ctrlpriv->caam_emi_slow); return 0; }
static int zynqmp_dpsub_remove(struct platform_device *pdev) { struct zynqmp_dpsub *dpsub = platform_get_drvdata(pdev); int err, ret = 0; xlnx_drm_pipeline_exit(dpsub->master); of_platform_depopulate(&pdev->dev); of_reserved_mem_device_release(&pdev->dev); component_del(&pdev->dev, &zynqmp_dpsub_component_ops); err = zynqmp_disp_remove(pdev); if (err) ret = -EIO; err = zynqmp_dp_remove(pdev); if (err) ret = -EIO; pm_runtime_disable(&pdev->dev); return err; }
static void qcom_smd_rpm_remove(struct rpmsg_device *rpdev) { of_platform_depopulate(&rpdev->dev); }
static int zynqmp_dpsub_probe(struct platform_device *pdev) { struct zynqmp_dpsub *dpsub; int ret; dpsub = devm_kzalloc(&pdev->dev, sizeof(*dpsub), GFP_KERNEL); if (!dpsub) return -ENOMEM; /* Sub-driver will access dpsub from drvdata */ platform_set_drvdata(pdev, dpsub); pm_runtime_enable(&pdev->dev); /* * DP should be probed first so that the zynqmp_disp can set the output * format accordingly. */ ret = zynqmp_dp_probe(pdev); if (ret) goto err_pm; ret = zynqmp_disp_probe(pdev); if (ret) goto err_dp; ret = component_add(&pdev->dev, &zynqmp_dpsub_component_ops); if (ret) goto err_disp; /* Try the reserved memory. Proceed if there's none */ of_reserved_mem_device_init(&pdev->dev); /* Populate the sound child nodes */ ret = of_platform_populate(pdev->dev.of_node, NULL, NULL, &pdev->dev); if (ret) { dev_err(&pdev->dev, "failed to populate child nodes\n"); goto err_rmem; } dpsub->master = xlnx_drm_pipeline_init(pdev); if (IS_ERR(dpsub->master)) { dev_err(&pdev->dev, "failed to initialize the drm pipeline\n"); goto err_populate; } dev_info(&pdev->dev, "ZynqMP DisplayPort Subsystem driver probed"); return 0; err_populate: of_platform_depopulate(&pdev->dev); err_rmem: of_reserved_mem_device_release(&pdev->dev); component_del(&pdev->dev, &zynqmp_dpsub_component_ops); err_disp: zynqmp_disp_remove(pdev); err_dp: zynqmp_dp_remove(pdev); err_pm: pm_runtime_disable(&pdev->dev); return ret; }
static void qcom_smd_rpm_remove(struct qcom_smd_device *sdev) { of_platform_depopulate(&sdev->dev); }