From patchwork Mon May 9 02:32:06 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xinliang Liu X-Patchwork-Id: 67333 Delivered-To: patch@linaro.org Received: by 10.140.92.199 with SMTP id b65csp1373764qge; Sun, 8 May 2016 19:24:22 -0700 (PDT) X-Received: by 10.98.42.196 with SMTP id q187mr28288999pfq.140.1462760662616; Sun, 08 May 2016 19:24:22 -0700 (PDT) Return-Path: Received: from gabe.freedesktop.org (gabe.freedesktop.org. [2610:10:20:722:a800:ff:fe36:1795]) by mx.google.com with ESMTP id n76si34486886pfa.84.2016.05.08.19.24.22; Sun, 08 May 2016 19:24:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) client-ip=2610:10:20:722:a800:ff:fe36:1795; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of dri-devel-bounces@lists.freedesktop.org designates 2610:10:20:722:a800:ff:fe36:1795 as permitted sender) smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 64ED76E092; Mon, 9 May 2016 02:24:19 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pf0-x229.google.com (mail-pf0-x229.google.com [IPv6:2607:f8b0:400e:c00::229]) by gabe.freedesktop.org (Postfix) with ESMTPS id C41086E092 for ; Mon, 9 May 2016 02:24:18 +0000 (UTC) Received: by mail-pf0-x229.google.com with SMTP id 206so70512506pfu.0 for ; Sun, 08 May 2016 19:24:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=BuMkiNoAUMZ2Hp1T85RjOWsa4VjSvvA+/6TYO2K8bOs=; b=Z4aqdB0cmTb2Wqfe/Qx4k8coCSFnpqyKA7C2jzLVnstvl/mhxO+6bM03rj0nNpNJ8w 7fZI1pPBcEEIoFckl6KGfgbxMnPPtN0sc+c3T3In+epi25j/dZeJrSITJdHMtLv+eZ7a doWNp+TEM7cuIfg/EP0CA1IkWJYVw5+cJLxHU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=BuMkiNoAUMZ2Hp1T85RjOWsa4VjSvvA+/6TYO2K8bOs=; b=l2odz073MojHwfEFOum3199l9nduym74jVFbteZ2UscwZ+igNhB4CewaTYcnalwOhD dC4sziaZ29LpaCoOKLtg4T+wjwhz62EBCnYlpPAP2ewW58RgBSSDQl372bFCji5Z2W3u xeokTl016A0XfJvRSC4kfCcuKahyz9q6SHyfEigVsKjzkfSvkMY2ekuTvLduTP9EU/wa TOWhxzsRAx6sWDBQbzDICOT3LXyDEZWP1c6d4pcwh1uqtKgnbKikb4TTKaXlmAKkCdEv fc5WRAS0R741VHZvdYSZ+oPuNHcwrh/T1Y/5SIjyoxOsTR+rGDVw+/BDDAW4uWCm/43v ccaw== X-Gm-Message-State: AOPr4FUNY3aBW07GSolCI7g+0ZdKrmB7AgVXVUh22gQmq2Zda44cQytgIiq7bdE3O9Adwkx1 X-Received: by 10.98.23.150 with SMTP id 144mr47070839pfx.96.1462760658349; Sun, 08 May 2016 19:24:18 -0700 (PDT) Received: from HTSAT-OPENLAB-SERVER.localdomain ([219.134.81.243]) by smtp.gmail.com with ESMTPSA id q70sm36066597pfj.81.2016.05.08.19.24.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sun, 08 May 2016 19:24:17 -0700 (PDT) From: Xinliang Liu To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/3] drm/hisilicon: Use drm_connector_register_all Date: Mon, 9 May 2016 10:32:06 +0800 Message-Id: <1462761128-106487-2-git-send-email-xinliang.liu@linaro.org> X-Mailer: git-send-email 2.8.2 In-Reply-To: <1462761128-106487-1-git-send-email-xinliang.liu@linaro.org> References: <1462761128-106487-1-git-send-email-xinliang.liu@linaro.org> Cc: daniel.vetter@ffwll.ch, juha_efku@dnainternet.net, daniel.vetter@intel.com X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" Use drm_connector_register_all helper to register connectors. Thanks to Daniel Vetter, this patch is raised by him. Signed-off-by: Xinliang Liu Signed-off-by: Daniel Vetter --- drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c | 31 +------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c b/drivers/gpu/drm/hisilicon/kirin/kirin_drm_drv.c index e102c9e1e7b2..bc410ee584b7 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;