drm_panel_add(&st7701->panel);
+ st7701->desc = desc;
+ st7701->dev = dev;
+
+ *ret_st7701 = st7701;
+
+ return 0;
+}
+
+static int st7701_dsi_probe(struct mipi_dsi_device *dsi)
+{
+ struct st7701 *st7701;
+ int ret;
+
+ ret = st7701_probe(&dsi->dev, &st7701);
+
+ if (ret)
+ return ret;
+
+ dsi->mode_flags = st7701->desc->flags;
+ dsi->format = st7701->desc->format;
+ dsi->lanes = st7701->desc->lanes;
+
mipi_dsi_set_drvdata(dsi, st7701);
st7701->dsi = dsi;
- st7701->desc = desc;
- return mipi_dsi_attach(dsi);
+ ret = mipi_dsi_attach(dsi);
+ if (ret)
+ goto err_attach;
+
+ return 0;
+
+ err_attach:
+ drm_panel_remove(&st7701->panel);
+ return ret;
}
static int st7701_dsi_remove(struct mipi_dsi_device *dsi)