linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jiri Slaby <jslaby@suse.cz>
To: Tomas Hlavacek <tmshlvck@gmail.com>
Cc: gregkh@linuxfoundation.org, alan@linux.intel.com,
	linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org,
	marek.vasut@gmail.com
Subject: Re: [PATCH v6] uartclk value from serial_core exposed to sysfs
Date: Thu, 06 Sep 2012 20:54:25 +0200	[thread overview]
Message-ID: <5048F161.3000805@suse.cz> (raw)
In-Reply-To: <CAEB7QLAWLuXFLWMYX70enP5X0z5EXTNo93hfOm7sH_kQteMAkA@mail.gmail.com>

On 09/06/2012 08:39 PM, Tomas Hlavacek wrote:
> On Thu, Sep 6, 2012 at 7:54 PM, Jiri Slaby <jslaby@suse.cz> 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

  reply	other threads:[~2012-09-06 18:54 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-10 22:28 RFC: exposing uartclk value to sysfs Tomas Hlavacek
2012-08-10 22:48 ` Alan Cox
2012-08-11  8:18   ` Tomas Hlavacek
2012-08-14  7:35 ` [PATCH 1/1] [RFC] uartclk from serial_core exposed " Tomas Hlavacek
2012-08-14 12:50   ` Marek Vasut
2012-08-15 17:09     ` Tomas Hlavacek
2012-08-15 17:12   ` [PATCHv2 " Tomas Hlavacek
2012-08-16 10:31   ` [PATCH " Alan Cox
2012-08-17 14:43   ` [PATCHv3 " Tomas Hlavacek
2012-08-17 15:06     ` Greg KH
2012-08-17 16:30       ` Tomas Hlavacek
2012-08-17 16:54         ` Greg KH
2012-08-17 18:44           ` Marek Vasut
2012-08-17 19:01             ` Greg KH
2012-08-17 20:25               ` Tomas Hlavacek
2012-08-17 15:07     ` Alan Cox
2012-08-19 18:34   ` [PATCHv4 " Tomas Hlavacek
2012-08-21 13:24     ` Tomas Hlavacek
2012-08-21 13:44       ` Alan Cox
2012-09-05 20:36     ` Greg KH
2012-09-05 23:16   ` [PATCHv5 1/1] uartclk value " Tomas Hlavacek
2012-09-05 23:42     ` Greg KH
2012-09-06  1:01       ` Tomas Hlavacek
2012-09-06  1:17   ` [PATCH v6] " Tomas Hlavacek
2012-09-06 16:23     ` [PATCH v6] tty: " Greg KH
2012-09-06 17:54     ` [PATCH v6] " Jiri Slaby
2012-09-06 18:39       ` Tomas Hlavacek
2012-09-06 18:54         ` Jiri Slaby [this message]
2012-09-06 19:41           ` Tomas Hlavacek
2012-09-06 19:47             ` Jiri Slaby

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=5048F161.3000805@suse.cz \
    --to=jslaby@suse.cz \
    --cc=alan@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --cc=marek.vasut@gmail.com \
    --cc=tmshlvck@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).