فهرست منبع

tile-srom: allow the driver to be built as a module

The code was already configured that way, but the Kconfig
file didn't support requesting it.

A buglet caused a null pointer deref when unloading the
module, but this commit also corrects that issue.

Signed-off-by: Chris Metcalf <cmetcalf@mellanox.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Chris Metcalf 8 سال پیش
والد
کامیت
71aeebff2c
2فایلهای تغییر یافته به همراه3 افزوده شده و 2 حذف شده
  1. 1 1
      drivers/char/Kconfig
  2. 2 1
      drivers/char/tile-srom.c

+ 1 - 1
drivers/char/Kconfig

@@ -577,7 +577,7 @@ config DEVPORT
 source "drivers/s390/char/Kconfig"
 
 config TILE_SROM
-	bool "Character-device access via hypervisor to the Tilera SPI ROM"
+	tristate "Character-device access via hypervisor to the Tilera SPI ROM"
 	depends on TILE
 	default y
 	---help---

+ 2 - 1
drivers/char/tile-srom.c

@@ -312,7 +312,8 @@ ATTRIBUTE_GROUPS(srom_dev);
 
 static char *srom_devnode(struct device *dev, umode_t *mode)
 {
-	*mode = S_IRUGO | S_IWUSR;
+	if (mode)
+		*mode = 0644;
 	return kasprintf(GFP_KERNEL, "srom/%s", dev_name(dev));
 }