Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752765Ab0KYLhr (ORCPT ); Thu, 25 Nov 2010 06:37:47 -0500 Received: from mail-fx0-f46.google.com ([209.85.161.46]:46744 "EHLO mail-fx0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752305Ab0KYLhq convert rfc822-to-8bit (ORCPT ); Thu, 25 Nov 2010 06:37:46 -0500 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=CMGCoHCKVVrj6aNAaWYj8BbHVQ3dX1hISyRg9Gd/MRPpw6eY+9nEJYKgRYfSYmJRVi 1ReXCmbblK/oD74HS+RhWmo7GmSHXTAjuPw+LAxtFYCIZp9+DZgmXhp1R2AF+L1ma9gN YiIMJxLckU6LLEu49IVQokVusHUV2VQhRGCEY= MIME-Version: 1.0 In-Reply-To: <1290642894-4577-1-git-send-email-jslaby@suse.cz> References: <1290642894-4577-1-git-send-email-jslaby@suse.cz> Date: Thu, 25 Nov 2010 22:37:44 +1100 Message-ID: Subject: Re: [PATCH 1/1] NET: wan/x25_asy, move lapb_unregister to x25_asy_close_tty From: Andrew Hendry To: Jiri Slaby Cc: davem@davemloft.net, netdev@vger.kernel.org, slapin@ossfans.org, linux-kernel@vger.kernel.org, jirislaby@gmail.com Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2334 Lines: 68 Sorry I haven't used this driver so can't fully test it. Looks straightforward and compile tested ok. On Thu, Nov 25, 2010 at 10:54 AM, Jiri Slaby wrote: > We register lapb when tty is created, but unregister it only when the > device is UP. So move the lapb_unregister to x25_asy_close_tty after > the device is down. > > Signed-off-by: Jiri Slaby > Reported-by: Sergey Lapin > Cc: Andrew Hendry > --- > ?drivers/net/wan/x25_asy.c | ? 11 ++++++----- > ?1 files changed, 6 insertions(+), 5 deletions(-) > > diff --git a/drivers/net/wan/x25_asy.c b/drivers/net/wan/x25_asy.c > index 66cda25..24297b2 100644 > --- a/drivers/net/wan/x25_asy.c > +++ b/drivers/net/wan/x25_asy.c > @@ -498,7 +498,6 @@ norbuff: > ?static int x25_asy_close(struct net_device *dev) > ?{ > ? ? ? ?struct x25_asy *sl = netdev_priv(dev); > - ? ? ? int err; > > ? ? ? ?spin_lock(&sl->lock); > ? ? ? ?if (sl->tty) > @@ -507,10 +506,6 @@ static int x25_asy_close(struct net_device *dev) > ? ? ? ?netif_stop_queue(dev); > ? ? ? ?sl->rcount = 0; > ? ? ? ?sl->xleft ?= 0; > - ? ? ? err = lapb_unregister(dev); > - ? ? ? if (err != LAPB_OK) > - ? ? ? ? ? ? ? printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", > - ? ? ? ? ? ? ? ? ? ? ? err); > ? ? ? ?spin_unlock(&sl->lock); > ? ? ? ?return 0; > ?} > @@ -595,6 +590,7 @@ static int x25_asy_open_tty(struct tty_struct *tty) > ?static void x25_asy_close_tty(struct tty_struct *tty) > ?{ > ? ? ? ?struct x25_asy *sl = tty->disc_data; > + ? ? ? int err; > > ? ? ? ?/* First make sure we're connected. */ > ? ? ? ?if (!sl || sl->magic != X25_ASY_MAGIC) > @@ -605,6 +601,11 @@ static void x25_asy_close_tty(struct tty_struct *tty) > ? ? ? ? ? ? ? ?dev_close(sl->dev); > ? ? ? ?rtnl_unlock(); > > + ? ? ? err = lapb_unregister(sl->dev); > + ? ? ? if (err != LAPB_OK) > + ? ? ? ? ? ? ? printk(KERN_ERR "x25_asy_close: lapb_unregister error -%d\n", > + ? ? ? ? ? ? ? ? ? ? ? err); > + > ? ? ? ?tty->disc_data = NULL; > ? ? ? ?sl->tty = NULL; > ? ? ? ?x25_asy_free(sl); > -- > 1.7.3.1 > > > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/