mirror of
https://github.com/torvalds/linux.git
synced 2026-05-28 17:13:52 +02:00
drm/exynos: mic: add a bridge at probe
This patch moves drm_bridge_add call into probe. It doesn't need to call drm_bridge_add call every time bind callback is called. Changelog v2 - moved drm_bridge_remove call into remove callback. - corrected description. Suggested-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Andrzej Hajda <a.hajda@samsung.com> Reviewed-by: Hoegeun Kwon <hoegeun.kwon@samsung.com> Signed-off-by: Inki Dae <inki.dae@samsung.com>
This commit is contained in:
parent
0d51a0a534
commit
576d72fbfb
|
|
@ -340,16 +340,10 @@ static int exynos_mic_bind(struct device *dev, struct device *master,
|
||||||
void *data)
|
void *data)
|
||||||
{
|
{
|
||||||
struct exynos_mic *mic = dev_get_drvdata(dev);
|
struct exynos_mic *mic = dev_get_drvdata(dev);
|
||||||
int ret;
|
|
||||||
|
|
||||||
mic->bridge.funcs = &mic_bridge_funcs;
|
|
||||||
mic->bridge.of_node = dev->of_node;
|
|
||||||
mic->bridge.driver_private = mic;
|
mic->bridge.driver_private = mic;
|
||||||
ret = drm_bridge_add(&mic->bridge);
|
|
||||||
if (ret)
|
|
||||||
DRM_ERROR("mic: Failed to add MIC to the global bridge list\n");
|
|
||||||
|
|
||||||
return ret;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static void exynos_mic_unbind(struct device *dev, struct device *master,
|
static void exynos_mic_unbind(struct device *dev, struct device *master,
|
||||||
|
|
@ -365,8 +359,6 @@ static void exynos_mic_unbind(struct device *dev, struct device *master,
|
||||||
|
|
||||||
already_disabled:
|
already_disabled:
|
||||||
mutex_unlock(&mic_mutex);
|
mutex_unlock(&mic_mutex);
|
||||||
|
|
||||||
drm_bridge_remove(&mic->bridge);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static const struct component_ops exynos_mic_component_ops = {
|
static const struct component_ops exynos_mic_component_ops = {
|
||||||
|
|
@ -461,6 +453,15 @@ static int exynos_mic_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
platform_set_drvdata(pdev, mic);
|
platform_set_drvdata(pdev, mic);
|
||||||
|
|
||||||
|
mic->bridge.funcs = &mic_bridge_funcs;
|
||||||
|
mic->bridge.of_node = dev->of_node;
|
||||||
|
|
||||||
|
ret = drm_bridge_add(&mic->bridge);
|
||||||
|
if (ret) {
|
||||||
|
DRM_ERROR("mic: Failed to add MIC to the global bridge list\n");
|
||||||
|
return ret;
|
||||||
|
}
|
||||||
|
|
||||||
pm_runtime_enable(dev);
|
pm_runtime_enable(dev);
|
||||||
|
|
||||||
ret = component_add(dev, &exynos_mic_component_ops);
|
ret = component_add(dev, &exynos_mic_component_ops);
|
||||||
|
|
@ -479,8 +480,13 @@ static int exynos_mic_probe(struct platform_device *pdev)
|
||||||
|
|
||||||
static int exynos_mic_remove(struct platform_device *pdev)
|
static int exynos_mic_remove(struct platform_device *pdev)
|
||||||
{
|
{
|
||||||
|
struct exynos_mic *mic = platform_get_drvdata(pdev);
|
||||||
|
|
||||||
component_del(&pdev->dev, &exynos_mic_component_ops);
|
component_del(&pdev->dev, &exynos_mic_component_ops);
|
||||||
pm_runtime_disable(&pdev->dev);
|
pm_runtime_disable(&pdev->dev);
|
||||||
|
|
||||||
|
drm_bridge_remove(&mic->bridge);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user