From mboxrd@z Thu Jan 1 00:00:00 1970 From: Greg KH Subject: Re: [PATCHv4 1/1] [RFC] uartclk from serial_core exposed to sysfs Date: Wed, 5 Sep 2012 13:36:41 -0700 Message-ID: <20120905203641.GA21427@kroah.com> References: <1344929718-22736-1-git-send-email-tmshlvck@gmail.com> <1345401285-14473-1-git-send-email-tmshlvck@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <1345401285-14473-1-git-send-email-tmshlvck@gmail.com> Sender: linux-kernel-owner@vger.kernel.org To: Tomas Hlavacek Cc: alan@linux.intel.com, linux-serial@vger.kernel.org, linux-kernel@vger.kernel.org, marek.vasut@gmail.com List-Id: linux-serial@vger.kernel.org On Sun, Aug 19, 2012 at 08:34:45PM +0200, Tomas Hlavacek wrote: > Added file /sys/devices/.../tty/ttySX/uartclk to allow reading > uartclk value in struct uart_port in serial_core via sysfs. > > It simplifies initialization verification of no-name cards that > have non-standard oscillator speed while having no distinguishing > PCI IDs to allow autodetection. > > tty_register_device() has been generalized and refactored in order > to add support for setting drvdata and attribute_group to the device. > > Signed-off-by: Tomas Hlavacek This looks good, but it doesn't apply to my tty-next branch in linux-next, so I can't apply it. But, when you redo it, here's one tiny thing to change: > +/** > + * tty_register_device_attr - register a tty device > + * @driver: the tty driver that describes the tty device > + * @index: the index in the tty driver for this tty device > + * @device: a struct device that is associated with this tty device. > + * This field is optional, if there is no known struct device > + * for this tty device it can be set to NULL safely. > + * @drvdata: Driver data to be set to device (NULL = do not touch). > + * @attr_grp: Attribute group to be set on device (NULL = do not touch). No need to mention the NULL thing here, "do not touch" doesn't mean much to me. > + if (attr_grp) > + dev->groups = attr_grp; > + if (drvdata) > + dev_set_drvdata(dev, drvdata); No need to test for NULL, just set them, it can't really hurt, right? thanks, greg k-h