Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3797168ybi; Mon, 29 Jul 2019 12:49:08 -0700 (PDT) X-Google-Smtp-Source: APXvYqwIdrzGDu9ivilicEmX7GThOOWlhc4mHJ263C3IIoNriVXb379YInj22Qr/qvTubTkPuBPs X-Received: by 2002:a17:90a:3225:: with SMTP id k34mr111953095pjb.31.1564429748718; Mon, 29 Jul 2019 12:49:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564429748; cv=none; d=google.com; s=arc-20160816; b=T2/zC/m7ZQSpYlDEQFQKNXmAuV6mvtmxcBcteagOFRnnVZGkFsa6+0OpSZjM/YDpJl 6FspKZ+iEsd1XhAjBWEaEQ9XxRKbRvmV1U/uE0Ip6bQspnNJpC1iWmz8GqLkZ04tLUuo j8bl56AJ+wqKw1kwLuphtweNU43cUQKnUyeRd2pAAtG2Edmsb0xq7RyHHoXI2pp0ic+0 kOugPn/V99ZDqpkb+hwCgTeaxnQ1QkK24cFypju7TkmaAB1HOqObzTLS6tFAbHWWv3eB Ny9QrAKY4XsaChFixHuthUdLyziRMxb/2i6EkDFVAKRLNCECT+d7YjffCv+2bx7HaobS LtHQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=M6Wchm9vp2igT0Gz5hrzpm2ha4xFyZ27sHdivlq2M8Q=; b=ds8SUxnLjn10lCedUIzI52s8fZSQa8BwdpT0RKFSmT7QRo1PJi7gKYQK0APYHwUDhL tPc9hnNM2csAetyiOBpUuMFh8DE9oktBUTDAQYgOMaw8ijxjMPmKaghX+re9bQ4TYstY pE9sFWte8K+JJtyvLfBsPKOwyEVHy1HIVf0+26aGNwPge5KQr4adXoOt59BIFRouAoOu qwxw9pTf97DaPbSIsUC8tyKE5cbqnQtHD6u3XcIQJWaFuUwlGPrphGRjMgMMDU89APbS JN8XXSQNVDrxATmlI+V4eS0QKTfVV0+rfoylWleBZY8LMnTnXyC50daS1AkglZ33lwx6 HOnw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dqWcDysF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id bd11si24581219plb.184.2019.07.29.12.48.53; Mon, 29 Jul 2019 12:49:08 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=dqWcDysF; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389542AbfG2Tqd (ORCPT + 99 others); Mon, 29 Jul 2019 15:46:33 -0400 Received: from mail.kernel.org ([198.145.29.99]:35838 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390188AbfG2Tqb (ORCPT ); Mon, 29 Jul 2019 15:46:31 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 498F220C01; Mon, 29 Jul 2019 19:46:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1564429590; bh=+SI3K2Y0+9e7gI8yc6Qawyhtxx+k1RYya+xsWYTVP5A=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=dqWcDysF7jtHFdRKUkQ4N3f9IGgnrSfdfPJDfecKjDG92dRpJ3vGO3YGpFNE/KFQx Grt4zc/bG6aX4EcRD8Xg4ri+/L6S+ucVmM2d6B+VS/l3jksUTZpuiqwHx596zggOHR sFGsnuUKUGbjR2d60++FqWZO4tSNbUCZi0mb2pLs= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Peter Ujfalusi , Thierry Reding , Sasha Levin Subject: [PATCH 5.2 005/215] drm/panel: simple: Fix panel_simple_dsi_probe Date: Mon, 29 Jul 2019 21:20:01 +0200 Message-Id: <20190729190740.640589521@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190729190739.971253303@linuxfoundation.org> References: <20190729190739.971253303@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 7ad9db66fafb0f0ad53fd2a66217105da5ddeffe ] In case mipi_dsi_attach() fails remove the registered panel to avoid added panel without corresponding device. Signed-off-by: Peter Ujfalusi Signed-off-by: Thierry Reding Link: https://patchwork.freedesktop.org/patch/msgid/20190226081153.31334-1-peter.ujfalusi@ti.com Signed-off-by: Sasha Levin --- drivers/gpu/drm/panel/panel-simple.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index 569be4efd8d1..48e2fa7bbe48 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -3098,7 +3098,14 @@ static int panel_simple_dsi_probe(struct mipi_dsi_device *dsi) dsi->format = desc->format; dsi->lanes = desc->lanes; - return mipi_dsi_attach(dsi); + err = mipi_dsi_attach(dsi); + if (err) { + struct panel_simple *panel = dev_get_drvdata(&dsi->dev); + + drm_panel_remove(&panel->base); + } + + return err; } static int panel_simple_dsi_remove(struct mipi_dsi_device *dsi) -- 2.20.1