Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752360AbcKHAMT (ORCPT ); Mon, 7 Nov 2016 19:12:19 -0500 Received: from mail.windriver.com ([147.11.1.11]:65412 "EHLO mail.windriver.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751648AbcKHAMS (ORCPT ); Mon, 7 Nov 2016 19:12:18 -0500 Date: Mon, 7 Nov 2016 19:12:07 -0500 From: Paul Gortmaker To: Chris Metcalf CC: , Arnd Bergmann , Greg Kroah-Hartman Subject: Re: [PATCH] tile-srom: allow the driver to be built as a module Message-ID: <20161108001207.GS26342@windriver.com> References: <20161031174954.7924-1-paul.gortmaker@windriver.com> <1478552197-6845-1-git-send-email-cmetcalf@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1478552197-6845-1-git-send-email-cmetcalf@mellanox.com> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1984 Lines: 60 [[PATCH] tile-srom: allow the driver to be built as a module] On 07/11/2016 (Mon 15:56) Chris Metcalf wrote: > 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 > --- > This is in response to Paul's patch (see the in-reply-to) suggesting > we remove the module infrastructure from the code instead. Fine by me; I have to default to keeping the code consistent with the way it used to be, but people who want modular use cases and can test those are welcome to extend the functionality accordingly. In the end I just want the code to be consistent with the Makefile/Kconfig. Thanks, Paul. -- > > 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 >