Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753726AbZJYTx4 (ORCPT ); Sun, 25 Oct 2009 15:53:56 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1751863AbZJYTxz (ORCPT ); Sun, 25 Oct 2009 15:53:55 -0400 Received: from smtp-out003.kontent.com ([81.88.40.217]:57092 "EHLO smtp-out003.kontent.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751748AbZJYTxy (ORCPT ); Sun, 25 Oct 2009 15:53:54 -0400 From: Oliver Neukum To: bart.hartgers@gmail.com Subject: Re: [PATCH 2/7] ark3116: (3rd try) Make existing functions 16450-aware and add close and release functions. Date: Sun, 25 Oct 2009 20:56:03 +0100 User-Agent: KMail/1.10.3 (Linux/2.6.31-rc9-0.1-default; KDE/4.1.3; x86_64; ; ) Cc: "Greg Kroah-Hartman" , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org References: <20091025175057.270011110@gmail.com> <20091025175318.709056986@gmail.com> In-Reply-To: <20091025175318.709056986@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-15" Content-Disposition: inline Message-Id: <200910252056.03993.oliver@neukum.org> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by alpha.home.local id n9PJsB16029120 Content-Length: 1156 Lines: 4 Am Sonntag, 25. Oktober 2009 18:50:59 schrieb bart.hartgers@gmail.com:> +static void ark3116_close(struct usb_serial_port *port)> +{> +???????struct usb_serial *serial = port->serial;> ?> -???????/* TEST ARK3116_SND(154, 0xFE, 0x40, 0xFFFF, 0x0006); */> +???????/* disable DMA */> +???????ark3116_write_reg(serial, UART_FCR, 0);> ?> -???????kfree(buf);> +???????/* deactivate interrupts */> +???????ark3116_write_reg(serial, UART_IER, 0);> ?> -???????return;> +???????if (serial->dev) {> +???????????????/* shutdown any bulk reads that might be going on */> +???????????????if (serial->num_bulk_out)> +???????????????????????usb_kill_urb(port->write_urb);> +???????????????if (serial->num_bulk_in)> +???????????????????????usb_kill_urb(port->read_urb);> +???????????????if (serial->num_interrupt_in)> +???????????????????????usb_kill_urb(port->interrupt_in_urb);> +???????}> ?} Why are the killings done on condition of serial-> != NULL but the registersare set unconditionally? Regards Oliver ????{.n?+???????+%?????ݶ??w??{.n?+????{??G?????{ay?ʇڙ?,j??f???h?????????z_??(?階?ݢj"???m??????G????????????&???~???iO???z??v?^?m???? ????????I?