提交 67601c3b 编写于 作者: L Linus Torvalds

Merge tag 'media/v4.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media

Pull media fixes from Mauro Carvalho Chehab:

  - deadlock fixes on driver probe at exynos4-is and s43-camif drivers

  - a build breakage if media controller is enabled and USB or PCI is
   built as module.

* tag 'media/v4.6-5' of git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/linux-media:
  [media] media-device: fix builds when USB or PCI is compiled as module
  [media] media: s3c-camif: fix deadlock on driver probe()
  [media] media: exynos4-is: fix deadlock on driver probe
...@@ -846,11 +846,11 @@ struct media_device *media_device_find_devres(struct device *dev) ...@@ -846,11 +846,11 @@ struct media_device *media_device_find_devres(struct device *dev)
} }
EXPORT_SYMBOL_GPL(media_device_find_devres); EXPORT_SYMBOL_GPL(media_device_find_devres);
#if IS_ENABLED(CONFIG_PCI)
void media_device_pci_init(struct media_device *mdev, void media_device_pci_init(struct media_device *mdev,
struct pci_dev *pci_dev, struct pci_dev *pci_dev,
const char *name) const char *name)
{ {
#ifdef CONFIG_PCI
mdev->dev = &pci_dev->dev; mdev->dev = &pci_dev->dev;
if (name) if (name)
...@@ -866,16 +866,16 @@ void media_device_pci_init(struct media_device *mdev, ...@@ -866,16 +866,16 @@ void media_device_pci_init(struct media_device *mdev,
mdev->driver_version = LINUX_VERSION_CODE; mdev->driver_version = LINUX_VERSION_CODE;
media_device_init(mdev); media_device_init(mdev);
#endif
} }
EXPORT_SYMBOL_GPL(media_device_pci_init); EXPORT_SYMBOL_GPL(media_device_pci_init);
#endif
#if IS_ENABLED(CONFIG_USB)
void __media_device_usb_init(struct media_device *mdev, void __media_device_usb_init(struct media_device *mdev,
struct usb_device *udev, struct usb_device *udev,
const char *board_name, const char *board_name,
const char *driver_name) const char *driver_name)
{ {
#ifdef CONFIG_USB
mdev->dev = &udev->dev; mdev->dev = &udev->dev;
if (driver_name) if (driver_name)
...@@ -895,9 +895,9 @@ void __media_device_usb_init(struct media_device *mdev, ...@@ -895,9 +895,9 @@ void __media_device_usb_init(struct media_device *mdev,
mdev->driver_version = LINUX_VERSION_CODE; mdev->driver_version = LINUX_VERSION_CODE;
media_device_init(mdev); media_device_init(mdev);
#endif
} }
EXPORT_SYMBOL_GPL(__media_device_usb_init); EXPORT_SYMBOL_GPL(__media_device_usb_init);
#endif
#endif /* CONFIG_MEDIA_CONTROLLER */ #endif /* CONFIG_MEDIA_CONTROLLER */
...@@ -1446,22 +1446,13 @@ static int fimc_md_probe(struct platform_device *pdev) ...@@ -1446,22 +1446,13 @@ static int fimc_md_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, fmd); platform_set_drvdata(pdev, fmd);
/* Protect the media graph while we're registering entities */
mutex_lock(&fmd->media_dev.graph_mutex);
ret = fimc_md_register_platform_entities(fmd, dev->of_node); ret = fimc_md_register_platform_entities(fmd, dev->of_node);
if (ret) { if (ret)
mutex_unlock(&fmd->media_dev.graph_mutex);
goto err_clk; goto err_clk;
}
ret = fimc_md_register_sensor_entities(fmd); ret = fimc_md_register_sensor_entities(fmd);
if (ret) { if (ret)
mutex_unlock(&fmd->media_dev.graph_mutex);
goto err_m_ent; goto err_m_ent;
}
mutex_unlock(&fmd->media_dev.graph_mutex);
ret = device_create_file(&pdev->dev, &dev_attr_subdev_conf_mode); ret = device_create_file(&pdev->dev, &dev_attr_subdev_conf_mode);
if (ret) if (ret)
......
...@@ -493,21 +493,17 @@ static int s3c_camif_probe(struct platform_device *pdev) ...@@ -493,21 +493,17 @@ static int s3c_camif_probe(struct platform_device *pdev)
if (ret < 0) if (ret < 0)
goto err_sens; goto err_sens;
mutex_lock(&camif->media_dev.graph_mutex);
ret = v4l2_device_register_subdev_nodes(&camif->v4l2_dev); ret = v4l2_device_register_subdev_nodes(&camif->v4l2_dev);
if (ret < 0) if (ret < 0)
goto err_unlock; goto err_sens;
ret = camif_register_video_nodes(camif); ret = camif_register_video_nodes(camif);
if (ret < 0) if (ret < 0)
goto err_unlock; goto err_sens;
ret = camif_create_media_links(camif); ret = camif_create_media_links(camif);
if (ret < 0) if (ret < 0)
goto err_unlock; goto err_sens;
mutex_unlock(&camif->media_dev.graph_mutex);
ret = media_device_register(&camif->media_dev); ret = media_device_register(&camif->media_dev);
if (ret < 0) if (ret < 0)
...@@ -516,8 +512,6 @@ static int s3c_camif_probe(struct platform_device *pdev) ...@@ -516,8 +512,6 @@ static int s3c_camif_probe(struct platform_device *pdev)
pm_runtime_put(dev); pm_runtime_put(dev);
return 0; return 0;
err_unlock:
mutex_unlock(&camif->media_dev.graph_mutex);
err_sens: err_sens:
v4l2_device_unregister(&camif->v4l2_dev); v4l2_device_unregister(&camif->v4l2_dev);
media_device_unregister(&camif->media_dev); media_device_unregister(&camif->media_dev);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册