From patchwork Sun Jun 19 02:15:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefan Agner X-Patchwork-Id: 9186009 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 6FA8C607FD for ; Sun, 19 Jun 2016 02:16:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4FA0F269E2 for ; Sun, 19 Jun 2016 02:16:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 400482723E; Sun, 19 Jun 2016 02:16:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A8138269E2 for ; Sun, 19 Jun 2016 02:16:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 78AC96E015; Sun, 19 Jun 2016 02:16:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail.kmu-office.ch (mail.kmu-office.ch [178.209.48.109]) by gabe.freedesktop.org (Postfix) with ESMTPS id A11126E015 for ; Sun, 19 Jun 2016 02:15:58 +0000 (UTC) Received: from trochilidae.lan (unknown [IPv6:2601:602:8801:aba5:3e97:eff:fe92:db3b]) by mail.kmu-office.ch (Postfix) with ESMTPSA id 9D7BD5C0463; Sun, 19 Jun 2016 04:12:48 +0200 (CEST) From: Stefan Agner To: dri-devel@lists.freedesktop.org Subject: [PATCH] drm/fsl-dcu: use drm_mode_config_cleanup on initialization errors Date: Sat, 18 Jun 2016 19:15:43 -0700 Message-Id: <20160619021543.23587-1-stefan@agner.ch> X-Mailer: git-send-email 2.8.3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=agner.ch; s=dkim; t=1466302370; bh=ul6JrjZIXDP4CGSCDZtSOCmCW+fSDyFc6jBeJ1PtcQM=; h=From:To:Cc:Subject:Date:Message-Id; b=e3XLVNcofyrC/AtLt5uusyb/LUYUfiZ0dOW6sGDXJCbhELR42dgwey+M1kp44R1DieeyU68xPMOyNEsAmfpCR/t5I8zB00Hjbi3LGwGs57QSG2P7sye13NMwmeQ5WuVddgQu+usTJjcd1uHmmWRzz/aeS3KFgqga6eNiZXZiZ8U= Cc: jianwei.wang.chn@gmail.com, meng.yi@nxp.com, linux-kernel@vger.kernel.org, alison.wang@freescale.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" X-Virus-Scanned: ClamAV using ClamSMTP Commit 7566e247672d ("drm/fsl-dcu: handle initialization errors properly") introduced error handling during initialization, but with a wrong cleanup order. Replace the error handling with the generic cleanup function drm_mode_config_cleanup. Signed-off-by: Stefan Agner --- drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c index c564ec6..a6e4cd5 100644 --- a/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c +++ b/drivers/gpu/drm/fsl-dcu/fsl_dcu_drm_kms.c @@ -37,23 +37,22 @@ int fsl_dcu_drm_modeset_init(struct fsl_dcu_drm_device *fsl_dev) ret = fsl_dcu_drm_crtc_create(fsl_dev); if (ret) - return ret; + goto err; ret = fsl_dcu_drm_encoder_create(fsl_dev, &fsl_dev->crtc); if (ret) - goto fail_encoder; + goto err; ret = fsl_dcu_drm_connector_create(fsl_dev, &fsl_dev->encoder); if (ret) - goto fail_connector; + goto err; drm_mode_config_reset(fsl_dev->drm); drm_kms_helper_poll_init(fsl_dev->drm); return 0; -fail_encoder: - fsl_dev->crtc.funcs->destroy(&fsl_dev->crtc); -fail_connector: - fsl_dev->encoder.funcs->destroy(&fsl_dev->encoder); + +err: + drm_mode_config_cleanup(fsl_dev->drm); return ret; }