drm/arc: Embedd a drm_connector for sim case

Removes the last devm_kzalloc, which means we're now prepared to use
drmm_mode_config_cleanup!

Acked-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Cc: Eugeniy Paltsev <Eugeniy.Paltsev@synopsys.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Alexey Brodkin <abrodkin@synopsys.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210112084358.2771527-5-daniel.vetter@ffwll.ch
This commit is contained in:
Daniel Vetter 2021-01-12 09:43:48 +01:00
Родитель 418fa90802
Коммит 1aae52630d
2 изменённых файлов: 2 добавлений и 13 удалений

Просмотреть файл

@ -15,6 +15,7 @@ struct arcpgu_drm_private {
void __iomem *regs;
struct clk *clk;
struct drm_simple_display_pipe pipe;
struct drm_connector sim_conn;
};
#define dev_to_arcpgu(x) container_of(x, struct arcpgu_drm_private, drm)

Просмотреть файл

@ -18,10 +18,6 @@
#define YRES_MAX 8192
struct arcpgu_drm_connector {
struct drm_connector connector;
};
static int arcpgu_drm_connector_get_modes(struct drm_connector *connector)
{
int count;
@ -57,7 +53,6 @@ static struct drm_encoder_funcs arcpgu_drm_encoder_funcs = {
int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np)
{
struct arcpgu_drm_private *arcpgu = dev_to_arcpgu(drm);
struct arcpgu_drm_connector *arcpgu_connector;
struct drm_encoder *encoder;
struct drm_connector *connector;
int ret;
@ -72,14 +67,7 @@ int arcpgu_drm_sim_init(struct drm_device *drm, struct device_node *np)
if (ret)
return ret;
arcpgu_connector = devm_kzalloc(drm->dev, sizeof(*arcpgu_connector),
GFP_KERNEL);
if (!arcpgu_connector) {
ret = -ENOMEM;
goto error_encoder_cleanup;
}
connector = &arcpgu_connector->connector;
connector = &arcpgu->sim_conn;
drm_connector_helper_add(connector, &arcpgu_drm_connector_helper_funcs);
ret = drm_connector_init(drm, connector, &arcpgu_drm_connector_funcs,