Commit 21d456a2 authored by Emil Velikov's avatar Emil Velikov

drm/malidp: convert platform driver to use dev_groups

Platform drivers now have the option to have the platform core create
and remove any needed sysfs attribute files.  So take advantage of that
and do not register "by hand" a sysfs file.

Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Brian Starkey <brian.starkey@arm.com>
Cc: Mali DP Maintainers <malidp@foss.arm.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: default avatarEmil Velikov <emil.l.velikov@gmail.com>
Tested-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Acked-by: default avatarLiviu Dudau <liviu.dudau@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200517193655.3895087-2-emil.l.velikov@gmail.com
parent 0f53f2da
...@@ -657,20 +657,11 @@ static ssize_t core_id_show(struct device *dev, struct device_attribute *attr, ...@@ -657,20 +657,11 @@ static ssize_t core_id_show(struct device *dev, struct device_attribute *attr,
static DEVICE_ATTR_RO(core_id); static DEVICE_ATTR_RO(core_id);
static int malidp_init_sysfs(struct device *dev) static struct attribute *mali_dp_attrs[] = {
{ &dev_attr_core_id.attr,
int ret = device_create_file(dev, &dev_attr_core_id); NULL,
};
if (ret) ATTRIBUTE_GROUPS(mali_dp);
DRM_ERROR("failed to create device file for core_id\n");
return ret;
}
static void malidp_fini_sysfs(struct device *dev)
{
device_remove_file(dev, &dev_attr_core_id);
}
#define MAX_OUTPUT_CHANNELS 3 #define MAX_OUTPUT_CHANNELS 3
...@@ -832,10 +823,6 @@ static int malidp_bind(struct device *dev) ...@@ -832,10 +823,6 @@ static int malidp_bind(struct device *dev)
if (ret < 0) if (ret < 0)
goto query_hw_fail; goto query_hw_fail;
ret = malidp_init_sysfs(dev);
if (ret)
goto init_fail;
/* Set the CRTC's port so that the encoder component can find it */ /* Set the CRTC's port so that the encoder component can find it */
malidp->crtc.port = of_graph_get_port_by_id(dev->of_node, 0); malidp->crtc.port = of_graph_get_port_by_id(dev->of_node, 0);
...@@ -893,8 +880,6 @@ static int malidp_bind(struct device *dev) ...@@ -893,8 +880,6 @@ static int malidp_bind(struct device *dev)
bind_fail: bind_fail:
of_node_put(malidp->crtc.port); of_node_put(malidp->crtc.port);
malidp->crtc.port = NULL; malidp->crtc.port = NULL;
init_fail:
malidp_fini_sysfs(dev);
malidp_fini(drm); malidp_fini(drm);
query_hw_fail: query_hw_fail:
pm_runtime_put(dev); pm_runtime_put(dev);
...@@ -927,7 +912,6 @@ static void malidp_unbind(struct device *dev) ...@@ -927,7 +912,6 @@ static void malidp_unbind(struct device *dev)
component_unbind_all(dev, drm); component_unbind_all(dev, drm);
of_node_put(malidp->crtc.port); of_node_put(malidp->crtc.port);
malidp->crtc.port = NULL; malidp->crtc.port = NULL;
malidp_fini_sysfs(dev);
malidp_fini(drm); malidp_fini(drm);
pm_runtime_put(dev); pm_runtime_put(dev);
if (pm_runtime_enabled(dev)) if (pm_runtime_enabled(dev))
...@@ -1023,6 +1007,7 @@ static struct platform_driver malidp_platform_driver = { ...@@ -1023,6 +1007,7 @@ static struct platform_driver malidp_platform_driver = {
.name = "mali-dp", .name = "mali-dp",
.pm = &malidp_pm_ops, .pm = &malidp_pm_ops,
.of_match_table = malidp_drm_of_match, .of_match_table = malidp_drm_of_match,
.dev_groups = mali_dp_groups,
}, },
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment