summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2016-05-12 11:11:03 +1000
committerDave Airlie <airlied@redhat.com>2016-05-12 11:11:03 +1000
commit93f517c4a76ffba270c42c9bf0bc32801572c077 (patch)
tree70ba7473c81aff9b653b331e509efe6b39b114c8 /drivers
parent6d23abf58a9afd3bc28aaf0384155b04c4b77912 (diff)
parent165cccc8437704d9f41eae2946774bdf2966245f (diff)
Merge branch 'drm-hisilicon-next' of github.com:xin3liang/linux into drm-next
misc hisilicon cleanups. * 'drm-hisilicon-next' of github.com:xin3liang/linux: drm/hisilicon: Fix DRM_INFO printed issue drm/hisilicon: Make kirin_drm_unbind sufficient drm/hisilicon: Use drm_connector_register_all
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c3
-rw-r--r--drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c38
2 files changed, 9 insertions, 32 deletions
diff --git a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
index bfbc2159250d..998452ad0fcb 100644
--- a/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
+++ b/drivers/gpu/drm/hisilicon/kirin/dw_drm_dsi.c
@@ -430,12 +430,13 @@ static void dsi_set_mipi_phy(void __iomem *base,
* wait for phy's clock ready
*/
delay_count = 100;
- while (delay_count--) {
+ while (delay_count) {
val = readl(base + PHY_STATUS);
if ((BIT(0) | BIT(2)) & val)
break;
udelay(1);
+ delay_count--;
}
if (!delay_count)
diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
index e102c9e1e7b2..3f94785fbcca 100644
--- a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
+++ b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c
@@ -201,35 +201,6 @@ static int compare_of(struct device *dev, void *data)
return dev->of_node == data;
}
-static int kirin_drm_connectors_register(struct drm_device *dev)
-{
- struct drm_connector *connector;
- struct drm_connector *failed_connector;
- int ret;
-
- mutex_lock(&dev->mode_config.mutex);
- drm_for_each_connector(connector, dev) {
- ret = drm_connector_register(connector);
- if (ret) {
- failed_connector = connector;
- goto err;
- }
- }
- mutex_unlock(&dev->mode_config.mutex);
-
- return 0;
-
-err:
- drm_for_each_connector(connector, dev) {
- if (failed_connector == connector)
- break;
- drm_connector_unregister(connector);
- }
- mutex_unlock(&dev->mode_config.mutex);
-
- return ret;
-}
-
static int kirin_drm_bind(struct device *dev)
{
struct drm_driver *driver = &kirin_drm_driver;
@@ -251,7 +222,7 @@ static int kirin_drm_bind(struct device *dev)
goto err_kms_cleanup;
/* connectors should be registered after drm device register */
- ret = kirin_drm_connectors_register(drm_dev);
+ ret = drm_connector_register_all(drm_dev);
if (ret)
goto err_drm_dev_unregister;
@@ -273,7 +244,12 @@ err_drm_dev_unref:
static void kirin_drm_unbind(struct device *dev)
{
- drm_put_dev(dev_get_drvdata(dev));
+ struct drm_device *drm_dev = dev_get_drvdata(dev);
+
+ drm_connector_unregister_all(drm_dev);
+ drm_dev_unregister(drm_dev);
+ kirin_drm_kms_cleanup(drm_dev);
+ drm_dev_unref(drm_dev);
}
static const struct component_master_ops kirin_drm_ops = {