From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jiri Slaby Subject: Re: [PATCH v6] uartclk value from serial_core exposed to sysfs Date: Thu, 06 Sep 2012 20:54:25 +0200 Message-ID: <5048F161.3000805@suse.cz> References: <1344929718-22736-1-git-send-email-tmshlvck@gmail.com> <1346894238-12870-1-git-send-email-tmshlvck@gmail.com> <5048E35F.5020304@suse.cz> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Return-path: Received: from mail-bk0-f46.google.com ([209.85.214.46]:51153 "EHLO mail-bk0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933001Ab2IFSya (ORCPT ); Thu, 6 Sep 2012 14:54:30 -0400 In-Reply-To: Sender: linux-serial-owner@vger.kernel.org List-Id: linux-serial@vger.kernel.org To: Tomas Hlavacek Cc: gregkh@linuxfoundation.org, alan@linux.intel.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, marek.vasut@gmail.com On 09/06/2012 08:39 PM, Tomas Hlavacek wrote: > On Thu, Sep 6, 2012 at 7:54 PM, Jiri Slaby wrote: >> On 09/06/2012 03:17 AM, Tomas Hlavacek wrote: >>> @@ -2362,8 +2392,8 @@ int uart_add_one_port(struct uart_driver *drv, struct uart_port *uport) >>> * Register the port whether it's detected or not. This allows >>> * setserial to be used to alter this ports parameters. >>> */ >>> - tty_dev = tty_port_register_device(port, drv->tty_driver, uport->line, >>> - uport->dev); >>> + tty_dev = tty_register_device_attr(drv->tty_driver, uport->line, >>> + uport->dev, port, tty_dev_attr_groups); >> >> This makes me believe you have not tested the change at all? > > Thanks! I can't believe I missed that. (And I actually tested that, > but I have to admit that it was not enough apparently.) > > I will re-send the patch (after some additional testing and double-checking). Ok. A couple more questions... * why are you passing tty_port to the struct device's private data and not uart_port proper? Is this for some future use? * cannot be all those attribute structs const? * kdoc for tty_register_device_attr says that when TTY_DRIVER_DYNAMIC_DEV is not set, tty_register_device_attr *should* not be called. But it must not be called, otherwise it will fail and emit a warning as a bonus, right? * final remark. I would prefer declaration and code be delimited by a new line in uart_get_attr_uartclk: <===> + int ret; + + struct tty_port *port = dev_get_drvdata(dev); + struct uart_state *state = container_of(port, struct uart_state, port); + mutex_lock(&state->port.mutex); <===> Like: <===> struct tty_port *port = ...; struct uart_state *state = ...; int ret; mutex_lock(&state->port.mutex); <===> regards, -- js suse labs