Received: by 2002:a05:6a10:d5a5:0:0:0:0 with SMTP id gn37csp4545823pxb; Tue, 5 Oct 2021 05:31:46 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxLC8FG+0SOdyQZHdG8CxaGkxfZzN4z4oROcCgV33khRzM5v13Xq6PfojoDDx1U4ACM0sMO X-Received: by 2002:a17:902:8347:b0:13d:e81d:3e76 with SMTP id z7-20020a170902834700b0013de81d3e76mr4944183pln.37.1633437106688; Tue, 05 Oct 2021 05:31:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1633437106; cv=none; d=google.com; s=arc-20160816; b=hP8BSMcWGO/n0cI6NLVICYSfzTJtxuo8o8KtRDe5kimBzspk5PasXnkWNbG6/3fAlj /qeTmQ0WrzFRqUmEhxWUDD2ftFk1+0heNBx2mNpnMqOs01Mr8F9CQwoNbTVYU4odMQHZ uQ16vmxq4xXYNA9r9jijiIU+LJi+9tJohnR2EMyIfI0GGJeCn7sMfXZU3GutX//0Zdw+ +GRrGR/KwwCtVBQ/Aov+4H/dU9v6v39PLEM8O1EikH+y67QeBIFoEWfPJLrWxF1Am1RI T4gWIi/VazhaqcBp4iDgskQQhtL+RK2+92+VZ26fHOJYDDTe/8yEJLQcrC0m1gJcTgLm 2DSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=4NdAi3zDuSj5qGJ/ajonopLJo9DAO1Ejrvtq/RbYibM=; b=pkSHBnBsFfOvZoS3/quQpa4NYCcxzevdg5Sv8Hj84Nf8bxtK1c3B7fe4xfNMEQ5pja EcI2lKVYvEN9A4E3HH1JdJ5l/jdZFctKO0pqiRYDFHYWsO7EHiPiNx/ZFl5N0SjJRxyE xBpCHmgy9DcrYkbd0PID1WolN3lyNHfyj6KT2FVxSEwJ2zhz0ALpZGio2atqK0PODzub rmbEug8Hme/GZZj0IufB+m5kUIyAENIPrJ6vGf+EyYaYVtAzJ2LlbFTOBCRuEhntwKm1 Xr/PnW4N752djae07DchJ5uSAaPGH9U3fZiMtyQCSdLi3cAZqNcgPCyoMBjJ9MKkgwU+ ZFQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=iSWyMaVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z23si22788340pga.370.2021.10.05.05.31.33; Tue, 05 Oct 2021 05:31:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@goldelico.com header.s=strato-dkim-0002 header.b=iSWyMaVa; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234858AbhJEMbj (ORCPT + 99 others); Tue, 5 Oct 2021 08:31:39 -0400 Received: from mo4-p02-ob.smtp.rzone.de ([81.169.146.168]:10762 "EHLO mo4-p02-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234303AbhJEMb2 (ORCPT ); Tue, 5 Oct 2021 08:31:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1633436963; s=strato-dkim-0002; d=goldelico.com; h=References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Cc:Date: From:Subject:Sender; bh=4NdAi3zDuSj5qGJ/ajonopLJo9DAO1Ejrvtq/RbYibM=; b=iSWyMaVawpbHYwhjGxFX9vpgB9CfSbYY2CbHnuugs8fjVBlFJObmv3luoq3TsWrrAC 6jN58lQXZwzkcap9U29+q8NrUImJoXRxxU7yPfcoTrONx/LlFmls7AGzEj0H81N2IRFV dox8DjDgTK2V+med77GhKIAre6LqBdJuM+eL/u0slLHZI1imQYrVQ/kyZtGqAqPdLGsI d7lUal/bO+OwfV0BjrRyI/odn2p5D7zjDGpkcbXB1MNR5QupSz7Ii14YyhFpOhfhNw5r Dy+rAv7jBUoVBRnGf3Kj6Cqdau6/d/wilu11Dxxa+gyVQe8q3UeAoi+hCqEKuaBJVWLY p7/Q== Authentication-Results: strato.com; dkim=none X-RZG-AUTH: ":JGIXVUS7cutRB/49FwqZ7WcJeFKiMhflhwDubTJ9o12DNOsPj0lByOdcKlH0" X-RZG-CLASS-ID: mo00 Received: from iMac.fritz.box by smtp.strato.de (RZmta 47.33.8 DYNA|AUTH) with ESMTPSA id I01f74x95CTM50a (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256 bits)) (Client did not present a certificate); Tue, 5 Oct 2021 14:29:22 +0200 (CEST) From: "H. Nikolaus Schaller" To: Paul Cercueil , Rob Herring , Mark Rutland , Thomas Bogendoerfer , "H. Nikolaus Schaller" , Geert Uytterhoeven , Kees Cook , "Eric W. Biederman" , Miquel Raynal , David Airlie , Daniel Vetter , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jernej Skrabec , Ezequiel Garcia , Harry Wentland , Sam Ravnborg , Maxime Ripard , Hans Verkuil , Liam Girdwood , Mark Brown , Paul Boddie Cc: devicetree@vger.kernel.org, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, letux-kernel@openphoenux.org, Jonas Karlman , dri-devel@lists.freedesktop.org Subject: [PATCH v5 1/7] drm/ingenic: Fix drm_init error path if IPU was registered Date: Tue, 5 Oct 2021 14:29:13 +0200 Message-Id: X-Mailer: git-send-email 2.33.0 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Paul Boddie If ingenic drm driver can not be registered, the IPU driver won't be deregistered. Code structure is chosen in preparation to add hdmi unregistration in error case following the same pattern by a later patch. Signed-off-by: Paul Boddie Signed-off-by: H. Nikolaus Schaller --- drivers/gpu/drm/ingenic/ingenic-drm-drv.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c index 35b61657d9f6..f73522bdacaa 100644 --- a/drivers/gpu/drm/ingenic/ingenic-drm-drv.c +++ b/drivers/gpu/drm/ingenic/ingenic-drm-drv.c @@ -1498,7 +1498,16 @@ static int ingenic_drm_init(void) return err; } - return platform_driver_register(&ingenic_drm_driver); + err = platform_driver_register(&ingenic_drm_driver); + if (err) + goto err_ipu_unreg; + + return 0; + +err_ipu_unreg: + if (IS_ENABLED(CONFIG_DRM_INGENIC_IPU)) + platform_driver_unregister(ingenic_ipu_driver_ptr); + return err; } module_init(ingenic_drm_init); -- 2.33.0