From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755074AbcHXNtq (ORCPT ); Wed, 24 Aug 2016 09:49:46 -0400 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:46446 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752054AbcHXNtl (ORCPT ); Wed, 24 Aug 2016 09:49:41 -0400 Date: Wed, 24 Aug 2016 14:46:44 +0100 From: One Thousand Gnomes To: Rob Herring Cc: Alan Cox , Greg Kroah-Hartman , Jiri Slaby , linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Hurley Subject: Re: [PATCH 1/2] tty: serial_core: convert uart_open to use tty_port_open Message-ID: <20160824144644.43543830@lxorguk.ukuu.org.uk> In-Reply-To: <20160822223910.24453-1-robh@kernel.org> References: <20160822223910.24453-1-robh@kernel.org> Organization: Intel Corporation X-Mailer: Claws Mail 3.13.2 (GTK+ 2.24.30; x86_64-redhat-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 22 Aug 2016 17:39:09 -0500 Rob Herring wrote: > tty_port_open handles much of the common parts of tty opening. Convert > uart_open to use it and move the serial_core specific parts into > tty_port.activate function. This will be needed to use tty_port functions > directly from in kernel clients. > > The tricky part is uart_port_startup can return positive values to allow > setserial to configure the port. We now return the positive value to > tty_port_open so that the tty is not marked as initialized and then set the > return value in uart_open to 0. > > Cc: Alan Cox > Cc: Peter Hurley > Signed-off-by: Rob Herring > --- > In looking at using tty_port for uart slaves, this is the first thing I > hit. serial_core doesn't even use the 2 functions that already exist for > tty_port and are needed. > > I've tested this on QEMU with pl011 and 8250 UARTs using setserial, but > I'm not sure what are all the tricky cases to handle. > > Greg, Don't apply these without comment from Alan and Peter. Originally I didn't convert them because the lockign was incompatible. That looks to have been fixed by other changes. This is definitely the right direction irrespective of the uart slave discussion. Acked-by: Alan Cox