All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Paul Gortmaker <paul.gortmaker@windriver.com>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Jiri Slaby <jslaby@suse.com>,
	linux-serial@vger.kernel.org
Subject: Re: [PATCH 4/5] drivers/tty: make serial/mpsc.c driver explicitly non-modular
Date: Fri, 9 Oct 2015 15:38:32 +0200	[thread overview]
Message-ID: <20151009133832.GA19165@ulmo> (raw)
In-Reply-To: <1440020889-12120-5-git-send-email-paul.gortmaker@windriver.com>

[-- Attachment #1: Type: text/plain, Size: 2236 bytes --]

On Wed, Aug 19, 2015 at 05:48:08PM -0400, Paul Gortmaker wrote:
> The Kconfig for this driver is currently:
> 
> config SERIAL_MPSC
>         bool "Marvell MPSC serial port support"
> 
> ...meaning that it currently is not being built as a module by anyone.
> Lets remove the modular code that is essentially orphaned, so that
> when reading the driver there is no doubt it is builtin-only.
> 
> Since module_init translates to device_initcall in the non-modular
> case, the init ordering remains unchanged with this commit.
> 
> We leave some tags like MODULE_AUTHOR for documentation purposes.
> 
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: Jiri Slaby <jslaby@suse.com>
> Cc: linux-serial@vger.kernel.org
> Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
> ---
>  drivers/tty/serial/mpsc.c | 36 +++---------------------------------
>  1 file changed, 3 insertions(+), 33 deletions(-)
> 
> diff --git a/drivers/tty/serial/mpsc.c b/drivers/tty/serial/mpsc.c
> index 82bb6d1fe23b..edb32e3f1e84 100644
> --- a/drivers/tty/serial/mpsc.c
> +++ b/drivers/tty/serial/mpsc.c
> @@ -55,8 +55,6 @@
>  #define SUPPORT_SYSRQ
>  #endif
>  
> -#include <linux/module.h>
> -#include <linux/moduleparam.h>
>  #include <linux/tty.h>
>  #include <linux/tty_flip.h>
>  #include <linux/ioport.h>
> @@ -2108,24 +2106,8 @@ static int mpsc_drv_probe(struct platform_device *dev)
>  	return rc;
>  }
>  
> -static int mpsc_drv_remove(struct platform_device *dev)
> -{
> -	pr_debug("mpsc_drv_exit: Removing MPSC %d\n", dev->id);
> -
> -	if (dev->id < MPSC_NUM_CTLRS) {
> -		uart_remove_one_port(&mpsc_reg, &mpsc_ports[dev->id].port);
> -		mpsc_release_port((struct uart_port *)
> -				&mpsc_ports[dev->id].port);
> -		mpsc_drv_unmap_regs(&mpsc_ports[dev->id]);
> -		return 0;
> -	} else {
> -		return -ENODEV;
> -	}
> -}
> -
>  static struct platform_driver mpsc_driver = {
>  	.probe	= mpsc_drv_probe,
> -	.remove	= mpsc_drv_remove,
>  	.driver	= {
>  		.name	= MPSC_CTLR_NAME,
>  	},

I don't think this is right. The driver can always be unbound from the
device via sysfs, in which case it will now leak resources and leave
behind a dangling UART port.

Thierry

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-10-09 13:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-08-19 21:48 [PATCH v2 0/5] drivers/tty: make more bool drivers explicitly non-modular Paul Gortmaker
2015-08-19 21:48 ` Paul Gortmaker
2015-08-19 21:48 ` Paul Gortmaker
2015-08-19 21:48 ` [PATCH 1/5] drivers/tty: make pty.c slightly more " Paul Gortmaker
2015-08-19 21:48 ` [PATCH 2/5] drivers/tty: make sysrq.c " Paul Gortmaker
2015-08-19 21:48 ` [PATCH 3/5] drivers/tty: make hvc_console.c " Paul Gortmaker
2015-08-19 21:48 ` [PATCH 4/5] drivers/tty: make serial/mpsc.c driver " Paul Gortmaker
2015-08-19 21:48   ` Paul Gortmaker
2015-10-09 13:38   ` Thierry Reding [this message]
2015-10-10 19:18     ` Paul Gortmaker
2015-10-10 19:18       ` Paul Gortmaker
2015-08-19 21:48 ` [PATCH 5/5] drivers/tty: make serial 8250_lpc18xx.c Kconfig a tristate Paul Gortmaker
2015-08-19 21:48   ` Paul Gortmaker
2015-08-19 21:48   ` Paul Gortmaker
2015-08-20  6:58   ` Joachim Eastwood
2015-08-20  6:58     ` Joachim Eastwood
2015-08-20  6:58     ` Joachim Eastwood
2015-09-26 22:53 ` [PATCH v2 0/5] drivers/tty: make more bool drivers explicitly non-modular Paul Gortmaker
2015-09-26 22:53   ` Paul Gortmaker
2015-09-26 22:53   ` Paul Gortmaker
2015-09-27 19:42   ` Greg Kroah-Hartman
2015-09-27 19:42     ` Greg Kroah-Hartman
  -- strict thread matches above, loose matches on Subject: below --
2015-08-09  0:51 [PATCH " Paul Gortmaker
2015-08-09  0:51 ` [PATCH 4/5] drivers/tty: make serial/mpsc.c driver " Paul Gortmaker
2015-08-09  0:51   ` Paul Gortmaker

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=20151009133832.GA19165@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=jslaby@suse.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.