linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@mellanox.com>
To: linux-kernel@vger.kernel.org,
	Paul Gortmaker <paul.gortmaker@windriver.com>,
	Arnd Bergmann <arnd@arndb.de>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: Chris Metcalf <cmetcalf@mellanox.com>
Subject: [PATCH] tile-srom: allow the driver to be built as a module
Date: Mon,  7 Nov 2016 15:56:37 -0500	[thread overview]
Message-ID: <1478552197-6845-1-git-send-email-cmetcalf@mellanox.com> (raw)
In-Reply-To: <20161031174954.7924-1-paul.gortmaker@windriver.com>

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>
---
This is in response to Paul's patch (see the in-reply-to) suggesting
we remove the module infrastructure from the code instead.

I can push this via the tile tree since it's a tile-only device,
or Greg, if you'd prefer to take it via your tree, that's fine too.

 drivers/char/Kconfig     | 2 +-
 drivers/char/tile-srom.c | 3 ++-
 2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig
index dcc09739a54e..70124ca5c33d 100644
--- a/drivers/char/Kconfig
+++ b/drivers/char/Kconfig
@@ -578,7 +578,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---
diff --git a/drivers/char/tile-srom.c b/drivers/char/tile-srom.c
index 398800edb2cc..3d4cca64b2d4 100644
--- a/drivers/char/tile-srom.c
+++ b/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));
 }
 
-- 
2.7.2

  reply	other threads:[~2016-11-07 21:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-31 17:49 [PATCH] char: make tile-srom explicitly non-modular Paul Gortmaker
2016-11-07 20:56 ` Chris Metcalf [this message]
2016-11-08  0:12   ` [PATCH] tile-srom: allow the driver to be built as a module Paul Gortmaker
2016-11-10 14:19   ` Greg Kroah-Hartman

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1478552197-6845-1-git-send-email-cmetcalf@mellanox.com \
    --to=cmetcalf@mellanox.com \
    --cc=arnd@arndb.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paul.gortmaker@windriver.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).