浏览代码

Staging: comedi: Make comedi_auto_config() succeed when auto-configuration disabled.

Otherwise it would not work properly.

From: Ian Abbott <abbotti@mev.co.uk>
Cc: Frank Mori Hess <fmhess@users.sourceforge.net>
Cc: David Schleef <ds@schleef.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Ian Abbott 16 年之前
父节点
当前提交
719548ef66
共有 1 个文件被更改,包括 4 次插入2 次删除
  1. 4 2
      drivers/staging/comedi/drivers.c

+ 4 - 2
drivers/staging/comedi/drivers.c

@@ -799,8 +799,10 @@ int comedi_auto_config(struct device *hardware_device, const char *board_name, c
 	int retval;
 	unsigned *private_data = NULL;
 
-	if (!comedi_autoconfig)
-		return -ENODEV;
+	if (!comedi_autoconfig) {
+		dev_set_drvdata(hardware_device, NULL);
+		return 0;
+	}
 
 	minor = comedi_alloc_board_minor(hardware_device);
 	if(minor < 0) return minor;