diff mbox

[1/4] sc16is7xx: remove ports on probe error path

Message ID 1426548529-21738-2-git-send-email-moorray3@wp.pl
State Not Applicable
Headers show

Commit Message

Jakub KiciƄski March 16, 2015, 11:28 p.m. UTC
From: Jakub Kicinski <kubakici@wp.pl>

If ports are not explicitly removed on the error path
the device will not get properly unregistered leaving
/dev/ttySC* nodes in the filesystem.

Signed-off-by: Jakub Kicinski <kubakici@wp.pl>
---
 drivers/tty/serial/sc16is7xx.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Jon Ringle March 17, 2015, 2:41 p.m. UTC | #1
On Mon, 16 Mar 2015, Jakub Kicinski wrote:

> From: Jakub Kicinski <kubakici@wp.pl>
> 
> If ports are not explicitly removed on the error path
> the device will not get properly unregistered leaving
> /dev/ttySC* nodes in the filesystem.
> 
> Signed-off-by: Jakub Kicinski <kubakici@wp.pl>

Signed-off-by: Jon Ringle <jringle@gridpoint.com>

> ---
>  drivers/tty/serial/sc16is7xx.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
> index df9a384dfbda..11bb44039a57 100644
> --- a/drivers/tty/serial/sc16is7xx.c
> +++ b/drivers/tty/serial/sc16is7xx.c
> @@ -1120,6 +1120,9 @@ static int sc16is7xx_probe(struct device *dev,
>  	if (!ret)
>  		return 0;
>  
> +	for (i = 0; i < s->uart.nr; i++)
> +		uart_remove_one_port(&s->uart, &s->p[i].port);
> +
>  	mutex_destroy(&s->mutex);
>  
>  #ifdef CONFIG_GPIOLIB
> -- 
> 2.1.0
> 
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-i2c" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/tty/serial/sc16is7xx.c b/drivers/tty/serial/sc16is7xx.c
index df9a384dfbda..11bb44039a57 100644
--- a/drivers/tty/serial/sc16is7xx.c
+++ b/drivers/tty/serial/sc16is7xx.c
@@ -1120,6 +1120,9 @@  static int sc16is7xx_probe(struct device *dev,
 	if (!ret)
 		return 0;
 
+	for (i = 0; i < s->uart.nr; i++)
+		uart_remove_one_port(&s->uart, &s->p[i].port);
+
 	mutex_destroy(&s->mutex);
 
 #ifdef CONFIG_GPIOLIB