Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp3095924ybi; Thu, 18 Jul 2019 20:57:23 -0700 (PDT) X-Google-Smtp-Source: APXvYqzEqeu08O1G6wjy5YLWKhyN+/8EJDN/eBj3lYI9ZmI3ViC7Nt5E65V08WU1ghNY59HknftL X-Received: by 2002:a17:902:27a8:: with SMTP id d37mr54290141plb.150.1563508643516; Thu, 18 Jul 2019 20:57:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563508643; cv=none; d=google.com; s=arc-20160816; b=U5lY/yx4Adt2Phdc3hvN4wJQK5Tn/yH8f+wwDKuX2Ipb6cRFSK0NVNMa0LhWZYb1l2 MY23Xx+IwcJrk2v5uTgF7bkYHkLS8eaeyMB7SAElgezOvvP0ct9i1wi+O+F9xvxYuRaW i/jEph7sOyo6h6CCpMZLl5Iu1zicuvSnP37ikzZWkms6c2s5hsRBWON48dQZthhipJnu Bf25jqF5AVwgc+Hc3fU90wm3UWzeCUiIgs2bp2nIcPdCEwRuTSeWvmMI7NqhKFaQaz0w Pq/trMgp66jV3lnvIfYTns80ESiZRr8TL9fmTDXb6kdtNNJodZ5N8DGAew1Z4gWHYfkL G10g== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=BphubxYcUGjuR37v9rNf4pTTJPrKOIfQ4ySKkeXZVIs=; b=xO4LN75IVRxrWMJbRDtzdHhnHInxhofjLZgY8ntIjyK6wguYk/qwPPKJRB7RNrvnF3 im2ZLJRwSocsVNGckVQqRDnUeWxYzIDVOjRFjaAKa5kx3i1yPPxWzXVN8mpLBvf+5JmT IS0Tz9LjM0lrxS6V97jLbgZX2bOc/Y0N8NgVemGFQ2u15H49mopcfw2WTEbH5EWenMSX NaJTtfCZlZnReRVvfOAbk0C6TMcpLNO0meDQDqqAAkHP9sfMCvwNPM0UQrsQyhGAgSJn 1xvFUQQpK+sq1jK8xysDFQVzUs4fmzvU51Fmqsm6Dir7ppjkLVGnFYVMk8epVyc+aj0H cedg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HSpLbV9R; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d7si90823plr.18.2019.07.18.20.57.08; Thu, 18 Jul 2019 20:57:23 -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=HSpLbV9R; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726726AbfGSD4s (ORCPT + 99 others); Thu, 18 Jul 2019 23:56:48 -0400 Received: from mail.kernel.org ([198.145.29.99]:56096 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726075AbfGSD4q (ORCPT ); Thu, 18 Jul 2019 23:56:46 -0400 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9E8E321851; Fri, 19 Jul 2019 03:56:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1563508606; bh=d3BMsEkTNMx8j/N8934+cKbPXfXt72kJy1smTyYx5EQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HSpLbV9RSBDInk/qNSelNdO2EhmI63RSxad6eTtMt8R61i9RCgtQmPoolNG001G6b T066GGDcH/Ol89lL8PcBULWzAAtHkOQ0qQMcJXeCgChV7OTrXl79wwGEBm0mGBPf/L jY76UkqGI8bEKadDav5yzhNJMcQqNOnXDlB6QhrM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Peter Ujfalusi , Thierry Reding , Sasha Levin , dri-devel@lists.freedesktop.org Subject: [PATCH AUTOSEL 5.2 002/171] drm/panel: simple: Fix panel_simple_dsi_probe Date: Thu, 18 Jul 2019 23:53:53 -0400 Message-Id: <20190719035643.14300-2-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190719035643.14300-1-sashal@kernel.org> References: <20190719035643.14300-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Peter Ujfalusi [ 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