mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Sascha Hauer <s.hauer@pengutronix.de>
To: Alexander Kurz <akurz@blala.de>
Cc: barebox@lists.infradead.org, Bastian Stender <bst@pengutronix.de>
Subject: Re: [PATCH] console: fix usbserial re-connect
Date: Wed, 29 Mar 2017 08:51:33 +0200	[thread overview]
Message-ID: <20170329065133.esikrtwah4jx3jbi@pengutronix.de> (raw)
In-Reply-To: <1490541467-15401-1-git-send-email-akurz@blala.de>

On Sun, Mar 26, 2017 at 05:17:47PM +0200, Alexander Kurz wrote:
> With commit b4f55fcf355a ("console: expose consoles in devfs") consoles
> got inserted, but never removed from devfs.
> When dealing with USB consoles, barebox should be prepared for devices
> spontaneously appering and disappering again (user disconnects and re-
> connects the cable). If the devfs entry is not removed upon disconnect,
> barebox will raise an error "device creation failed with File exists"
> when the cable is connected again.
> 
> Remove devfs entries when consoles are de-registered.
> Also change the error message, it's the devfs entry.
> 
> Signed-off-by: Alexander Kurz <akurz@blala.de>
> ---
>  common/console.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)

Also applied to master, thanks

Sascha

> 
> diff --git a/common/console.c b/common/console.c
> index 4127e76..74fb684 100644
> --- a/common/console.c
> +++ b/common/console.c
> @@ -375,7 +375,7 @@ int console_register(struct console_device *newcdev)
>  	ret = devfs_create(&newcdev->devfs);
>  
>  	if (ret) {
> -		pr_err("device creation failed with %s\n", strerror(-ret));
> +		pr_err("devfs entry creation failed: %s\n", strerror(-ret));
>  		return ret;
>  	}
>  
> @@ -388,6 +388,8 @@ int console_unregister(struct console_device *cdev)
>  	struct device_d *dev = &cdev->class_dev;
>  	int status;
>  
> +	devfs_remove(&cdev->devfs);
> +
>  	list_del(&cdev->list);
>  	if (list_empty(&console_list))
>  		initialized = CONSOLE_UNINITIALIZED;
> -- 
> 2.1.4
> 
> 
> _______________________________________________
> barebox mailing list
> barebox@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/barebox
> 

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |

_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

      reply	other threads:[~2017-03-29  6:51 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-26 15:17 Alexander Kurz
2017-03-29  6:51 ` Sascha Hauer [this message]

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=20170329065133.esikrtwah4jx3jbi@pengutronix.de \
    --to=s.hauer@pengutronix.de \
    --cc=akurz@blala.de \
    --cc=barebox@lists.infradead.org \
    --cc=bst@pengutronix.de \
    /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