Re: [PATCH v2 2/3] drm: Plumb debugfs_init through to panels

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 15.02.2022 23:09, Javier Martinez Canillas wrote:
Hello Doug,

On 2/5/22 01:13, Douglas Anderson wrote:

[snip]

+static void panel_bridge_debugfs_init(struct drm_bridge *bridge,
+				      struct dentry *root)
+{
+	struct panel_bridge *panel_bridge = drm_bridge_to_panel_bridge(bridge);
+	struct drm_panel *panel = panel_bridge->panel;
+
+	root = debugfs_create_dir("panel", root);
This could return a ERR_PTR(-errno) if the function doesn't succeed.

I noticed that most kernel code doesn't check the return value though...

+	if (panel->funcs->debugfs_init)
Probably if (!(IS_ERR(root) && panel->funcs->debugfs_init) ?

+		panel->funcs->debugfs_init(panel, root);
+}
[snip]

@@ -436,6 +436,9 @@ void drm_debugfs_connector_add(struct drm_connector *connector)
  	/* vrr range */
  	debugfs_create_file("vrr_range", S_IRUGO, root, connector,
  			    &vrr_range_fops);
Same here, wonder if the return value should be checked.

I've seen sometimes that file/dir was already created with the same name, reporting error in such case will be helpful.

Regards
Andrzej


I leave it to you to decide, but regardless of that the patch looks good to me.

Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>

Best regards,




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux