aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@google.com>2024-04-16 09:39:38 +0000
committerGreg Kroah-Hartman <gregkh@google.com>2024-04-21 12:29:59 +0000
commitd364016872f2e1bf9be8fc2d76c57f80b7ad0c11 (patch)
tree7807336ff958ea1e02f719b6e8a128588de5bd51
parentff7fafe3e6be2182e264b631f1e459291908cac3 (diff)
downloadhikey-linaro-d364016872f2e1bf9be8fc2d76c57f80b7ad0c11.tar.gz
Revert "drm/mipi-dsi: Fix detach call without attach"
This reverts commit 425a441c5c32cf8ad26f28006267ff2d972927c9 which is commit 90d50b8d85834e73536fdccd5aa913b30494fef0 upstream. It breaks the Android kernel abi and can be brought back in the future in an abi-safe way if it is really needed. Bug: 161946584 Change-Id: Icadd1f376dcf40c38d733025b32bcfc8f10e2caa Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
-rw-r--r--drivers/gpu/drm/drm_mipi_dsi.c17
-rw-r--r--include/drm/drm_mipi_dsi.h2
2 files changed, 2 insertions, 17 deletions
diff --git a/drivers/gpu/drm/drm_mipi_dsi.c b/drivers/gpu/drm/drm_mipi_dsi.c
index c2fa109751d0..7171e3781324 100644
--- a/drivers/gpu/drm/drm_mipi_dsi.c
+++ b/drivers/gpu/drm/drm_mipi_dsi.c
@@ -301,8 +301,7 @@ static int mipi_dsi_remove_device_fn(struct device *dev, void *priv)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
- if (dsi->attached)
- mipi_dsi_detach(dsi);
+ mipi_dsi_detach(dsi);
mipi_dsi_device_unregister(dsi);
return 0;
@@ -325,18 +324,11 @@ EXPORT_SYMBOL(mipi_dsi_host_unregister);
int mipi_dsi_attach(struct mipi_dsi_device *dsi)
{
const struct mipi_dsi_host_ops *ops = dsi->host->ops;
- int ret;
if (!ops || !ops->attach)
return -ENOSYS;
- ret = ops->attach(dsi->host, dsi);
- if (ret)
- return ret;
-
- dsi->attached = true;
-
- return 0;
+ return ops->attach(dsi->host, dsi);
}
EXPORT_SYMBOL(mipi_dsi_attach);
@@ -348,14 +340,9 @@ int mipi_dsi_detach(struct mipi_dsi_device *dsi)
{
const struct mipi_dsi_host_ops *ops = dsi->host->ops;
- if (WARN_ON(!dsi->attached))
- return -EINVAL;
-
if (!ops || !ops->detach)
return -ENOSYS;
- dsi->attached = false;
-
return ops->detach(dsi->host, dsi);
}
EXPORT_SYMBOL(mipi_dsi_detach);
diff --git a/include/drm/drm_mipi_dsi.h b/include/drm/drm_mipi_dsi.h
index 57abc8d5fa14..05592c17da0c 100644
--- a/include/drm/drm_mipi_dsi.h
+++ b/include/drm/drm_mipi_dsi.h
@@ -173,7 +173,6 @@ struct mipi_dsi_device_info {
* struct mipi_dsi_device - DSI peripheral device
* @host: DSI host for this peripheral
* @dev: driver model device node for this peripheral
- * @attached: the DSI device has been successfully attached
* @name: DSI peripheral chip type
* @channel: virtual channel assigned to the peripheral
* @format: pixel format for video mode
@@ -189,7 +188,6 @@ struct mipi_dsi_device_info {
struct mipi_dsi_device {
struct mipi_dsi_host *host;
struct device dev;
- bool attached;
char name[DSI_DEV_NAME_SIZE];
unsigned int channel;