Skip to content

Commit f84e1ba

Browse files
evelikovdaeinki
authored andcommitted
drm/exynos-vidi: 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: Inki Dae <[email protected]> Cc: Joonyoung Shim <[email protected]> Cc: Seung-Woo Kim <[email protected]> Cc: Kyungmin Park <[email protected]> Cc: [email protected] Signed-off-by: Emil Velikov <[email protected]> Signed-off-by: Inki Dae <[email protected]>
1 parent 547a734 commit f84e1ba

File tree

1 file changed

+8
-18
lines changed

1 file changed

+8
-18
lines changed

drivers/gpu/drm/exynos/exynos_drm_vidi.c

Lines changed: 8 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,12 @@ static ssize_t vidi_store_connection(struct device *dev,
214214
static DEVICE_ATTR(connection, 0644, vidi_show_connection,
215215
vidi_store_connection);
216216

217+
static struct attribute *vidi_attrs[] = {
218+
&dev_attr_connection.attr,
219+
NULL,
220+
};
221+
ATTRIBUTE_GROUPS(vidi);
222+
217223
int vidi_connection_ioctl(struct drm_device *drm_dev, void *data,
218224
struct drm_file *file_priv)
219225
{
@@ -439,7 +445,6 @@ static int vidi_probe(struct platform_device *pdev)
439445
{
440446
struct vidi_context *ctx;
441447
struct device *dev = &pdev->dev;
442-
int ret;
443448

444449
ctx = devm_kzalloc(dev, sizeof(*ctx), GFP_KERNEL);
445450
if (!ctx)
@@ -453,23 +458,7 @@ static int vidi_probe(struct platform_device *pdev)
453458

454459
platform_set_drvdata(pdev, ctx);
455460

456-
ret = device_create_file(dev, &dev_attr_connection);
457-
if (ret < 0) {
458-
DRM_DEV_ERROR(dev,
459-
"failed to create connection sysfs.\n");
460-
return ret;
461-
}
462-
463-
ret = component_add(dev, &vidi_component_ops);
464-
if (ret)
465-
goto err_remove_file;
466-
467-
return ret;
468-
469-
err_remove_file:
470-
device_remove_file(dev, &dev_attr_connection);
471-
472-
return ret;
461+
return component_add(dev, &vidi_component_ops);
473462
}
474463

475464
static int vidi_remove(struct platform_device *pdev)
@@ -494,5 +483,6 @@ struct platform_driver vidi_driver = {
494483
.driver = {
495484
.name = "exynos-drm-vidi",
496485
.owner = THIS_MODULE,
486+
.dev_groups = vidi_groups,
497487
},
498488
};

0 commit comments

Comments
 (0)