From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3BE2F4519A0 for ; Wed, 12 Aug 2026 15:10:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.50 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786547407; cv=none; b=AZhq8fA8flTdh36/dIDSkuNXM3PefB2prbv9acgllb2FiUWN9lhtNaMSzgHg7C/Prh2rFK99KJrVVXAFEl6mDJoKDP7Ud2D8xPgQFrxHwlEbuOjBk9wWyqQqcMBhp1BsBMheFv3BGqPaJHXguhI3q+Qo1BGaUBMHztQZYXEIzGg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1786547407; c=relaxed/simple; bh=oeS1oiOhxBysqMlVPJcbeLSywUhDz+m+iPpBCTZ+L+A=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=VoupDJGPYi92VsWsxYV0H8KVz5Oo+U1+5ODQFHrGo2wRHB4dYh+DX7fnGaD3599grS7QVXEZyVXZ+k9oFrqgcVRtz8Zb1gIuHxGhPp89lPxL0zLDcBRuc5CZGohp0zb0szLtJFSad5iqFrnpeOfnyvsxCHxMG1OMej1JVla+lHA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=sla1HeEN; arc=none smtp.client-ip=209.85.221.50 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="sla1HeEN" Received: by mail-wr1-f50.google.com with SMTP id ffacd0b85a97d-47fecbbafdaso335643f8f.0 for ; Wed, 12 Aug 2026 08:10:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1786547403; x=1787152203; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to:content-type; bh=AQVNKUE+2hv/nyQaIYFaSOsEs/Rbw0Wp9MEMFm9oMXE=; b=sla1HeENC6mzek1eM20/WJ5CtXe6rw6LjGB9+TzltO0KGdZTqB2dNbW/LIL6wXjaMj tEHDzq8txVWd2ydxIS6kkV5SH/xrZK7NTLBL1rWpnsb9eNRBBealpbdWwvamDyo/7n2/ j0HbVP+Or1nuMUuHJs+kMQN9nT0eAZyHE66vYgHWq5TjnPHQAeTBVfzjnZyfCR7pX7Gz jhFnho+RfuVPb4If4+5Wip/8agEKNZJAk4Hg996i1oP6B/bgcEnSkz1ohNnghivyxd0m TCNZiqFjOS/VsCTYqCKXzQZbkAQgvlEepqVDeLWLsNZsrBpUkXu2NCa2bGmUA260RFyX qI/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1786547403; x=1787152203; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to:content-type; bh=AQVNKUE+2hv/nyQaIYFaSOsEs/Rbw0Wp9MEMFm9oMXE=; b=qGUMaFSsqEepExKf7b+LDcBLQXePcQivAdWYr9ziKZcUgxUgtJ/Ry1HsMTfL6k6C9S +oHm6yfFeMNdF/6mNtnKSIyI4URkppht6NYMJChDn7jQ8yl/LNl8bTk7rxgJluENUI/c iz3YWK1jNzfqyXeSBnssayLqWODXHKFyimuubiUBWdYUzpP9rPWlWFQKomlfWbIaJ7Lo yhPHJINPIZAfX68UR48PWAAJtl7evq6+tXrGHgkiA0lrLN/GUwp7IffjykfIKipJLA1g HQia8bXPhH1e06vdZqCaKFXNLri3eK910Fivn3qORpQA0VjH5Ts/Hu/Wz2muos6yl1Fg zVDg== X-Forwarded-Encrypted: i=1; AHgh+RpJeGuzqKgrYLFMYFMSC01M98pEe5nAsJQyKQnjJbW9TjRsThsXUVzkUVxjwx7KPZjLulAmdLsjrBln0Zc=@vger.kernel.org X-Gm-Message-State: AOJu0YyR89Z+FqUr3n8okbn+adr6gMLRQI7bEI1+K4a5iekmiZpbLgKD UZIIcLfkMETkpi8AUNlqgEWcvKb4O+/rPXEQ5F9wYEZVZ4e1PG9QwcOI X-Gm-Gg: AR+sD1222eYO7woVd5k0EPjbCYuZPTowCNlpxUUKnnd93GoDeHk0zP9sTJOZBewIlKM xpJ8pg7/aSYJAHJ2YuZ7FQWDUeyEh3TLzpcmfnJk6rHCju+nHMUqIm4kVuf4Z1pIhTucDLj5YU/ e1adDyHNjojd6f5DsoC3gLfTZmv5OdlDxZIERYLAFCCz9Hng6Usq6BxAouBYW2XU/2d3FAlI5O0 oOuDvkt02g9FwEZ5ocWJx5ugsUMplnuaSkepj46eKUUuOrCxZGA0/EfxB8vPV+U6/0w9ITg5zJd tUrgaWu3f5bHYFFqNBnV8kbwQffH8/ypyNu9w50X4vEXklEQWfy9xxSZxolC7Nh3WUeWWHVWxJ6 0f++hgINCwRcaL7pf05wgRVIf9RW9JvUKpRRqa7E7m10b78xjnl3e68nveh1rBFhiFl3xJndbu9 NPBfFOiSoyVAqb0CeB33VqkrtHCujNHFEu17qJYrlgxbL5qrW4cLiWlkUYg3cxd0TlWPQcj3jb6 HVk7109xyYCJ1KepjlpsVI9SQ== X-Received: by 2002:a05:600c:1d20:b0:499:7ce1:d8a2 with SMTP id 5b1f17b1804b1-4997ce1da7amr58659875e9.8.1786547403228; Wed, 12 Aug 2026 08:10:03 -0700 (PDT) Received: from osama.. ([2a02:908:185:7e40:3d2e:78f3:cfb2:413d]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4997c94f4c0sm48743035e9.8.2026.08.12.08.10.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Aug 2026 08:10:02 -0700 (PDT) From: Osama Abdelkader To: luca.ceresoli@bootlin.com, Neil Armstrong , Jessica Zhang , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Ondrej Jirman , Javier Martinez Canillas , Michael Trimarchi , Michael Walle , Dario Binacchi , dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org Cc: Osama Abdelkader Subject: [PATCH v4 4/6] drm/panel: Use managed helpers in Himax and Ilitek panels Date: Wed, 12 Aug 2026 17:09:59 +0200 Message-ID: <20260812151000.74799-1-osama.abdelkader@gmail.com> X-Mailer: git-send-email 2.43.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use the managed MIPI DSI attach and panel add helpers in Himax and Ilitek panel drivers and drop the corresponding manual detach and panel remove calls from remove paths. Suggested-by: Luca Ceresoli Signed-off-by: Osama Abdelkader --- v4: - use devm_drm_panel_add instead of drm_panel_add. drivers/gpu/drm/panel/panel-himax-hx83102.c | 24 ++--------------- drivers/gpu/drm/panel/panel-himax-hx83112a.c | 24 ++++------------- drivers/gpu/drm/panel/panel-himax-hx83112b.c | 23 ++++------------ drivers/gpu/drm/panel/panel-himax-hx8394.c | 26 +++++-------------- drivers/gpu/drm/panel/panel-ilitek-ili9805.c | 21 +++------------ .../drm/panel/panel-ilitek-ili9806e-core.c | 12 +-------- .../drm/panel/panel-ilitek-ili9806e-core.h | 1 - .../gpu/drm/panel/panel-ilitek-ili9806e-dsi.c | 16 +----------- .../gpu/drm/panel/panel-ilitek-ili9806e-spi.c | 6 ----- drivers/gpu/drm/panel/panel-ilitek-ili9881c.c | 15 +++-------- drivers/gpu/drm/panel/panel-ilitek-ili9882t.c | 24 ++--------------- 11 files changed, 30 insertions(+), 162 deletions(-) diff --git a/drivers/gpu/drm/panel/panel-himax-hx83102.c b/drivers/gpu/drm/panel/panel-himax-hx83102.c index 6a0851ccf9bb..3ef052571ce0 100644 --- a/drivers/gpu/drm/panel/panel-himax-hx83102.c +++ b/drivers/gpu/drm/panel/panel-himax-hx83102.c @@ -1284,9 +1284,7 @@ static int hx83102_panel_add(struct hx83102 *ctx) ctx->base.funcs = &hx83102_drm_funcs; ctx->base.dev = &ctx->dsi->dev; - drm_panel_add(&ctx->base); - - return 0; + return devm_drm_panel_add(dev, &ctx->base); } static int hx83102_probe(struct mipi_dsi_device *dsi) @@ -1318,24 +1316,7 @@ static int hx83102_probe(struct mipi_dsi_device *dsi) mipi_dsi_set_drvdata(dsi, ctx); - ret = mipi_dsi_attach(dsi); - if (ret) - drm_panel_remove(&ctx->base); - - return ret; -} - -static void hx83102_remove(struct mipi_dsi_device *dsi) -{ - struct hx83102 *ctx = mipi_dsi_get_drvdata(dsi); - int ret; - - ret = mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); - - if (ctx->base.dev) - drm_panel_remove(&ctx->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } static const struct of_device_id hx83102_of_match[] = { @@ -1369,7 +1350,6 @@ MODULE_DEVICE_TABLE(of, hx83102_of_match); static struct mipi_dsi_driver hx83102_driver = { .probe = hx83102_probe, - .remove = hx83102_remove, .driver = { .name = "panel-himax-hx83102", .of_match_table = hx83102_of_match, diff --git a/drivers/gpu/drm/panel/panel-himax-hx83112a.c b/drivers/gpu/drm/panel/panel-himax-hx83112a.c index 142cb1cc067a..36ebfad7a3e9 100644 --- a/drivers/gpu/drm/panel/panel-himax-hx83112a.c +++ b/drivers/gpu/drm/panel/panel-himax-hx83112a.c @@ -303,28 +303,15 @@ static int hx83112a_probe(struct mipi_dsi_device *dsi) if (ret) return dev_err_probe(dev, ret, "Failed to get backlight\n"); - drm_panel_add(&ctx->panel); - - ret = mipi_dsi_attach(dsi); - if (ret < 0) { - dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - drm_panel_remove(&ctx->panel); + ret = devm_drm_panel_add(dev, &ctx->panel); + if (ret) return ret; - } - return 0; -} - -static void hx83112a_remove(struct mipi_dsi_device *dsi) -{ - struct hx83112a_panel *ctx = mipi_dsi_get_drvdata(dsi); - int ret; - - ret = mipi_dsi_detach(dsi); + ret = devm_mipi_dsi_attach(dev, dsi); if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); + return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - drm_panel_remove(&ctx->panel); + return 0; } static const struct of_device_id hx83112a_of_match[] = { @@ -335,7 +322,6 @@ MODULE_DEVICE_TABLE(of, hx83112a_of_match); static struct mipi_dsi_driver hx83112a_driver = { .probe = hx83112a_probe, - .remove = hx83112a_remove, .driver = { .name = "panel-himax-hx83112a", .of_match_table = hx83112a_of_match, diff --git a/drivers/gpu/drm/panel/panel-himax-hx83112b.c b/drivers/gpu/drm/panel/panel-himax-hx83112b.c index 41f21f8c1373..569ed2dec87c 100644 --- a/drivers/gpu/drm/panel/panel-himax-hx83112b.c +++ b/drivers/gpu/drm/panel/panel-himax-hx83112b.c @@ -386,29 +386,17 @@ static int hx83112b_probe(struct mipi_dsi_device *dsi) return dev_err_probe(dev, PTR_ERR(ctx->panel.backlight), "Failed to create backlight\n"); - drm_panel_add(&ctx->panel); + ret = devm_drm_panel_add(dev, &ctx->panel); + if (ret) + return ret; - ret = mipi_dsi_attach(dsi); - if (ret < 0) { - drm_panel_remove(&ctx->panel); + ret = devm_mipi_dsi_attach(dev, dsi); + if (ret < 0) return dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - } return 0; } -static void hx83112b_remove(struct mipi_dsi_device *dsi) -{ - struct hx83112b_panel *ctx = mipi_dsi_get_drvdata(dsi); - int ret; - - ret = mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id hx83112b_of_match[] = { { .compatible = "djn,98-03057-6598b-i" }, { /* sentinel */ } @@ -417,7 +405,6 @@ MODULE_DEVICE_TABLE(of, hx83112b_of_match); static struct mipi_dsi_driver hx83112b_driver = { .probe = hx83112b_probe, - .remove = hx83112b_remove, .driver = { .name = "panel-himax-hx83112b", .of_match_table = hx83112b_of_match, diff --git a/drivers/gpu/drm/panel/panel-himax-hx8394.c b/drivers/gpu/drm/panel/panel-himax-hx8394.c index 09124610fdc8..4180d4aadf5e 100644 --- a/drivers/gpu/drm/panel/panel-himax-hx8394.c +++ b/drivers/gpu/drm/panel/panel-himax-hx8394.c @@ -1023,14 +1023,13 @@ static int hx8394_probe(struct mipi_dsi_device *dsi) ctx->panel.prepare_prev_first = true; - drm_panel_add(&ctx->panel); - - ret = mipi_dsi_attach(dsi); - if (ret < 0) { - dev_err_probe(dev, ret, "mipi_dsi_attach failed\n"); - drm_panel_remove(&ctx->panel); + ret = devm_drm_panel_add(dev, &ctx->panel); + if (ret) return ret; - } + + ret = devm_mipi_dsi_attach(dev, dsi); + if (ret < 0) + return dev_err_probe(dev, ret, "mipi_dsi_attach failed\n"); dev_dbg(dev, "%ux%u@%u %ubpp dsi %udl - ready\n", ctx->desc->mode->hdisplay, ctx->desc->mode->vdisplay, @@ -1040,18 +1039,6 @@ static int hx8394_probe(struct mipi_dsi_device *dsi) return 0; } -static void hx8394_remove(struct mipi_dsi_device *dsi) -{ - struct hx8394 *ctx = mipi_dsi_get_drvdata(dsi); - int ret; - - ret = mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "Failed to detach from DSI host: %d\n", ret); - - drm_panel_remove(&ctx->panel); -} - static const struct of_device_id hx8394_of_match[] = { { .compatible = "hannstar,hsd060bhw4", .data = &hsd060bhw4_desc }, { .compatible = "huiling,hl055fhav028c", .data = &hl055fhav028c_desc }, @@ -1065,7 +1052,6 @@ MODULE_DEVICE_TABLE(of, hx8394_of_match); static struct mipi_dsi_driver hx8394_driver = { .probe = hx8394_probe, - .remove = hx8394_remove, .driver = { .name = DRV_NAME, .of_match_table = hx8394_of_match, diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9805.c b/drivers/gpu/drm/panel/panel-ilitek-ili9805.c index 5610a225f77b..976305991b7f 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9805.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9805.c @@ -305,31 +305,19 @@ static int ili9805_dsi_probe(struct mipi_dsi_device *dsi) if (ret) return ret; - drm_panel_add(&ctx->panel); + ret = devm_drm_panel_add(&dsi->dev, &ctx->panel); + if (ret) + return ret; - ret = mipi_dsi_attach(dsi); + ret = devm_mipi_dsi_attach(&dsi->dev, dsi); if (ret < 0) { dev_err(&dsi->dev, "mipi_dsi_attach failed: %d\n", ret); - drm_panel_remove(&ctx->panel); return ret; } return 0; } -static void ili9805_dsi_remove(struct mipi_dsi_device *dsi) -{ - struct ili9805 *ctx = mipi_dsi_get_drvdata(dsi); - int ret; - - ret = mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", - ret); - - drm_panel_remove(&ctx->panel); -} - static const struct ili9805_desc gpm1780a0_desc = { .init = gpm1780a0_init, .mode = &gpm1780a0_timing, @@ -353,7 +341,6 @@ MODULE_DEVICE_TABLE(of, ili9805_of_match); static struct mipi_dsi_driver ili9805_dsi_driver = { .probe = ili9805_dsi_probe, - .remove = ili9805_dsi_remove, .driver = { .name = "ili9805-dsi", .of_match_table = ili9805_of_match, diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c index 53e25d1086db..81d48c402aec 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.c @@ -112,21 +112,11 @@ int ili9806e_probe(struct device *dev, void *transport, if (set_prepare_prev_first) ctx->panel.prepare_prev_first = true; - drm_panel_add(&ctx->panel); - - return 0; + return devm_drm_panel_add(dev, &ctx->panel); } EXPORT_SYMBOL_GPL(ili9806e_probe); -void ili9806e_remove(struct device *dev) -{ - struct ili9806e *ctx = dev_get_drvdata(dev); - - drm_panel_remove(&ctx->panel); -} -EXPORT_SYMBOL_GPL(ili9806e_remove); - MODULE_AUTHOR("Dario Binacchi "); MODULE_AUTHOR("Gunnar Dibbern "); MODULE_AUTHOR("Michael Walle "); diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.h b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.h index dddece62cf42..fded4b6793e7 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.h +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-core.h @@ -10,6 +10,5 @@ int ili9806e_power_on(struct device *dev); int ili9806e_probe(struct device *dev, void *transport, const struct drm_panel_funcs *funcs, int connector_type); -void ili9806e_remove(struct device *dev); #endif /* _PANEL_ILITEK_ILI9806E_CORE_H */ diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c index 0fb06c425545..89915d58f69d 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-dsi.c @@ -141,20 +141,7 @@ static int ili9806e_dsi_probe(struct mipi_dsi_device *dsi) if (ret) return ret; - ret = mipi_dsi_attach(dsi); - if (ret < 0) { - dev_err_probe(dev, ret, "Failed to attach to DSI host\n"); - ili9806e_remove(dev); - return ret; - } - - return 0; -} - -static void ili9806e_dsi_remove(struct mipi_dsi_device *dsi) -{ - mipi_dsi_detach(dsi); - ili9806e_remove(&dsi->dev); + return devm_mipi_dsi_attach(dev, dsi); } static void com35h3p70ulc_init(struct mipi_dsi_multi_context *ctx) @@ -490,7 +477,6 @@ static struct mipi_dsi_driver ili9806e_dsi_driver = { .of_match_table = ili9806e_dsi_of_match, }, .probe = ili9806e_dsi_probe, - .remove = ili9806e_dsi_remove, }; module_mipi_dsi_driver(ili9806e_dsi_driver); diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c index 9d10b0d28f52..187bcb084dd9 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9806e-spi.c @@ -124,11 +124,6 @@ static int ili9806e_spi_probe(struct spi_device *spi) DRM_MODE_CONNECTOR_DPI); } -static void ili9806e_spi_remove(struct spi_device *spi) -{ - ili9806e_remove(&spi->dev); -} - static void rk050hr345_ct106a_init(struct ili9806e_spi_panel *ctx) { struct mipi_dbi *dbi = &ctx->dbi; @@ -313,7 +308,6 @@ static struct spi_driver ili9806e_spi_driver = { .of_match_table = ili9806e_spi_of_match, }, .probe = ili9806e_spi_probe, - .remove = ili9806e_spi_remove, .id_table = ili9806e_spi_ids, }; module_spi_driver(ili9806e_spi_driver); diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c index 3abdd0870e83..aee114a40cfd 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9881c.c @@ -2591,21 +2591,15 @@ static int ili9881c_dsi_probe(struct mipi_dsi_device *dsi) if (ret) return ret; - drm_panel_add(&ctx->panel); + ret = devm_drm_panel_add(&dsi->dev, &ctx->panel); + if (ret) + return ret; dsi->mode_flags = ctx->desc->mode_flags; dsi->format = MIPI_DSI_FMT_RGB888; dsi->lanes = ctx->desc->lanes; - return mipi_dsi_attach(dsi); -} - -static void ili9881c_dsi_remove(struct mipi_dsi_device *dsi) -{ - struct ili9881c *ctx = mipi_dsi_get_drvdata(dsi); - - mipi_dsi_detach(dsi); - drm_panel_remove(&ctx->panel); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } static const struct ili9881c_desc lhr050h41_desc = { @@ -2719,7 +2713,6 @@ MODULE_DEVICE_TABLE(of, ili9881c_of_match); static struct mipi_dsi_driver ili9881c_dsi_driver = { .probe = ili9881c_dsi_probe, - .remove = ili9881c_dsi_remove, .driver = { .name = "ili9881c-dsi", .of_match_table = ili9881c_of_match, diff --git a/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c b/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c index 6d07fe901357..d4b383138488 100644 --- a/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c +++ b/drivers/gpu/drm/panel/panel-ilitek-ili9882t.c @@ -809,9 +809,7 @@ static int ili9882t_add(struct ili9882t *ili) ili->base.funcs = &ili9882t_funcs; ili->base.dev = &ili->dsi->dev; - drm_panel_add(&ili->base); - - return 0; + return devm_drm_panel_add(dev, &ili->base); } static int ili9882t_probe(struct mipi_dsi_device *dsi) @@ -844,24 +842,7 @@ static int ili9882t_probe(struct mipi_dsi_device *dsi) mipi_dsi_set_drvdata(dsi, ili); - ret = mipi_dsi_attach(dsi); - if (ret) - drm_panel_remove(&ili->base); - - return ret; -} - -static void ili9882t_remove(struct mipi_dsi_device *dsi) -{ - struct ili9882t *ili = mipi_dsi_get_drvdata(dsi); - int ret; - - ret = mipi_dsi_detach(dsi); - if (ret < 0) - dev_err(&dsi->dev, "failed to detach from DSI host: %d\n", ret); - - if (ili->base.dev) - drm_panel_remove(&ili->base); + return devm_mipi_dsi_attach(&dsi->dev, dsi); } static const struct of_device_id ili9882t_of_match[] = { @@ -881,7 +862,6 @@ static struct mipi_dsi_driver ili9882t_driver = { .of_match_table = ili9882t_of_match, }, .probe = ili9882t_probe, - .remove = ili9882t_remove, }; module_mipi_dsi_driver(ili9882t_driver); -- 2.43.0