sync with OpenBSD -current

This commit is contained in:
purplerain 2024-02-06 19:52:24 +00:00
parent 0bc0a510b3
commit 593fd57b5d
Signed by: purplerain
GPG key ID: F42C07F07E2E35B7
61 changed files with 797 additions and 428 deletions

View file

@ -353,7 +353,8 @@ static int mipi_dsi_remove_device_fn(struct device *dev, void *priv)
{
struct mipi_dsi_device *dsi = to_mipi_dsi_device(dev);
mipi_dsi_detach(dsi);
if (dsi->attached)
mipi_dsi_detach(dsi);
mipi_dsi_device_unregister(dsi);
return 0;
@ -378,11 +379,18 @@ 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;
return ops->attach(dsi->host, dsi);
ret = ops->attach(dsi->host, dsi);
if (ret)
return ret;
dsi->attached = true;
return 0;
}
EXPORT_SYMBOL(mipi_dsi_attach);
@ -394,9 +402,14 @@ 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);