Re: [RFC PATCH v3 1/3] drivers/accel: define kconfig and register a new major

From: Jeffrey Hugo
Date: Mon Nov 07 2022 - 11:13:31 EST


On 11/6/2022 2:02 PM, Oded Gabbay wrote:
+int __init accel_core_init(void)
+{
+ int ret;
+
+ ret = accel_sysfs_init();
+ if (ret < 0) {
+ DRM_ERROR("Cannot create ACCEL class: %d\n", ret);
+ goto error;
+ }
+
+ accel_debugfs_root = debugfs_create_dir("accel", NULL);
+
+ ret = register_chrdev(ACCEL_MAJOR, "accel", &accel_stub_fops);
+ if (ret < 0)
+ goto error;

We are not jumping over anything here. Seems like this whole if block could just be removed.

+
+error:
+ /* Any cleanup will be done in drm_core_exit() that will call
+ * to accel_core_exit()
+ */

This doesn't look like the standard multi-line comment style. Are we going to say that the accel subsystem follows net and differs from the kernel standard?

+ return ret;
+}