linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marek Vasut <marek.vasut@gmail.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Tomas Hlavacek <tmshlvck@gmail.com>,
	alan@linux.intel.com, linux-serial@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCHv3 1/1] [RFC] uartclk from serial_core exposed to sysfs
Date: Fri, 17 Aug 2012 20:44:14 +0200	[thread overview]
Message-ID: <201208172044.14868.marek.vasut@gmail.com> (raw)
In-Reply-To: <20120817165446.GA12361@kroah.com>

Dear Greg KH,

> On Fri, Aug 17, 2012 at 06:30:36PM +0200, Tomas Hlavacek wrote:
> > Hello Greg!
> > 
> > On Fri, Aug 17, 2012 at 5:06 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > >> @@ -2355,6 +2373,14 @@ int uart_add_one_port(struct uart_driver *drv,
> > >> struct uart_port *uport)
> > >> 
> > >>       }
> > >>       
> > >>       /*
> > >> 
> > >> +      * Expose uartclk in sysfs. Use driverdata of the tty device for
> > >> +      * referencing the UART port.
> > >> +      */
> > >> +     dev_set_drvdata(tty_dev, port);
> > >> +     if (device_create_file(tty_dev, &dev_attr_uartclk) < 0)
> > >> +             dev_err(tty_dev, "Failed to add uartclk attr\n");
> > > 
> > > I think you just raced with userspace in creating the file after the
> > > device was announced to userspace.  Are you sure it's ok?
> > > 
> > > If not (hint, I don't think so), please make it a default attribute of
> > > the device, which will then cause the file to be created before it is
> > > announced to userspace.  It will also be less code as you don't have to
> > > clean it up by hand :)
> > 
> > Do you mean I should modify the tty_register_device() function not to
> > use device_create() but it should rather do the device initialization
> > on it's own.
> 
> No, not at all.
> 
> > And I should add add the attribute (via struct attribute_group) to
> > struct device in between device_initialize() and device_add() calls.
> > Did I get it right?
> 
> No, make this a driver attribute, that way when the device is
> registered, it adds the attribute automagically to the device that is
> bound to it.

(hint, DEVICE_ATTR), right ?

> Does that make sense?
> 
> greg k-h

Best regards,
Marek Vasut

  reply	other threads:[~2012-08-17 18:44 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAEB7QLAJXkK6NDPVDi36n_U_X_DGh5niHJhH6FpqBUZFmXQ2Xg@mail.gmail.com>
2012-08-14  7:35 ` [PATCH 1/1] [RFC] uartclk from serial_core exposed to sysfs 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 [this message]
2012-08-17 19:01             ` Greg KH
2012-08-17 20:25               ` Tomas Hlavacek
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
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=201208172044.14868.marek.vasut@gmail.com \
    --to=marek.vasut@gmail.com \
    --cc=alan@linux.intel.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.kernel.org \
    --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).