linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Pavel Machek <pavel@ucw.cz>
Cc: NeilBrown <neil@brown.name>, Mark Rutland <mark.rutland@arm.com>,
	One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
	Peter Hurley <peter@hurleysoftware.com>,
	Arnd Bergmann <arnd@arndb.de>,
	devicetree@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Sebastian Reichel <sre@kernel.org>,
	linux-kernel@vger.kernel.org,
	GTA04 owners <gta04-owner@goldelico.com>,
	Grant Likely <grant.likely@linaro.org>,
	Jiri Slaby <jslaby@suse.cz>
Subject: Re: [Gta04-owner] [PATCH 2/3] TTY: add support for tty_slave devices.
Date: Sun, 22 Mar 2015 14:42:09 +1100	[thread overview]
Message-ID: <20150322144209.14abc603@notabene.brown> (raw)
In-Reply-To: <20150320194150.GB28194@amd>

[-- Attachment #1: Type: text/plain, Size: 2350 bytes --]

On Fri, 20 Mar 2015 20:41:50 +0100 Pavel Machek <pavel@ucw.cz> wrote:

> Hi!
> 
> (And yes, I now see dts examples, sorry for the noise.)
> 
> Acked-by: Pavel Machek <pavel@ucw.cz>
> 
> Minor nits below.
> 
> > --- /dev/null
> > +++ b/drivers/tty/slave/tty_slave_core.c
> > @@ -0,0 +1,136 @@
> > +/*
> > + * tty-slave-core - device bus for tty slaves
> 
> Filename actually uses underscores.

The filename uses underscores because all the filenames in drivers/tty do.
And this isn't a file name, it is more like a module name, and the module
tools treat '-' and '_' as equivalent.
And I prefer hyphen....

I looked at other files in drivers/tty and decided noticed that they use
spaces to separate words in this context (novel concept :-) so I've done the
same.

> 
> > +			container_of(parent, struct tty_slave, dev);
> > +		tty->ops = &dev->ops;
> > +	}
> > +}
> > +EXPORT_SYMBOL(tty_slave_activate);
> 
> Not "_GPL"?

Other exports in the files are just EXPORT_SYMBOL, so I copied.
I don't feel strongly (the code is GPL anyway) so just follow what
surrounding code does.

> 
> > +postcore_initcall(tty_slave_init);
> > +module_exit(tty_slave_exit);
> 
> Should it have MODULE_LICENSE tag?

Yes. Added.

> 
> 
> > +int tty_register_finalize(struct tty_driver *driver, struct device *dev)
> > +{
> > +	int retval;
> > +	bool cdev = false;
> > +	int index = dev->devt - MKDEV(driver->major,
> > +				      driver->minor_start);
> > +	printk("REGISTER %d %d 0x%x %d\n", driver->major, driver->minor_start, dev->devt, index);
> 
> That printk should probably be removed for merge?

Gone.

> 
> > +	if (!(driver->flags & TTY_DRIVER_DYNAMIC_ALLOC)) {
> > +		retval = tty_cdev_add(driver,
> > +				      dev->devt,
> > +				      index, 1);
> 
> You can put this on one line.

Indeed.  Done.

> 
> > --- /dev/null
> > +++ b/include/linux/tty_slave.h
> > @@ -0,0 +1,26 @@
> > +
> > +struct tty_slave {
> > +	struct device *tty_dev;
> > +	struct tty_driver *tty_drv;
> > +	struct tty_operations ops;
> > +	struct device dev;
> > +};
> 
> Header files usually have #include guards, and some kind of comment on
> top.
> 
> 									Pavel

Of 1996 files in include/linux, 1851 seem to do that.  That's enough to
convince me.  I've done it too.

Thanks,
NeilBrown


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 811 bytes --]

  reply	other threads:[~2015-03-22  3:42 UTC|newest]

Thread overview: 80+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-18  5:58 [PATCH 0/3] tty slave device support - version 3 NeilBrown
2015-03-18  5:58 ` [PATCH 2/3] TTY: add support for tty_slave devices NeilBrown
2015-03-18  9:11   ` Paul Bolle
2015-03-22  3:32     ` NeilBrown
2015-03-20 19:41   ` Pavel Machek
2015-03-22  3:42     ` NeilBrown [this message]
2015-03-22  7:58       ` [Gta04-owner] " Pavel Machek
2015-03-24 10:31   ` Jiri Slaby
2015-03-30 23:45     ` NeilBrown
2015-03-25 16:30   ` Peter Hurley
2015-03-25 21:17     ` [Gta04-owner] " NeilBrown
2015-03-27 11:09       ` Peter Hurley
2015-03-31  0:33         ` NeilBrown
2015-03-18  5:58 ` [PATCH 1/3] TTY: use class_find_device to find port in uart_suspend/resume NeilBrown
2015-03-25 16:20   ` Peter Hurley
2015-03-29 21:49     ` [Gta04-owner] " NeilBrown
2015-03-18  5:58 ` [PATCH 3/3] tty/slaves: add a driver to power on/off UART attached devices NeilBrown
2015-03-20  7:54   ` [Gta04-owner] " Dr. H. Nikolaus Schaller
2015-03-20  8:54     ` NeilBrown
2015-03-20  9:34       ` Dr. H. Nikolaus Schaller
2015-03-20 19:50         ` Pavel Machek
2015-03-20 23:31         ` NeilBrown
2015-03-24 17:58           ` Dr. H. Nikolaus Schaller
2015-03-25  1:45             ` Sebastian Reichel
2015-03-25  7:59               ` Dr. H. Nikolaus Schaller
2015-03-25 15:21                 ` Sebastian Reichel
2015-03-25 16:44                   ` Dr. H. Nikolaus Schaller
2015-03-26 18:08                     ` Sebastian Reichel
2015-03-27  9:22                       ` Dr. H. Nikolaus Schaller
2015-03-27 16:31                         ` Sebastian Reichel
2015-03-27 17:11                           ` Dr. H. Nikolaus Schaller
2015-04-27 20:35                             ` Pavel Machek
2015-04-29  6:56                               ` Dr. H. Nikolaus Schaller
2015-03-25 20:53                 ` Pavel Machek
2015-03-25 21:25                   ` Dr. H. Nikolaus Schaller
2015-03-26  5:56                     ` Pavel Machek
2015-03-26  6:44                       ` Dr. H. Nikolaus Schaller
2015-04-04  7:52                         ` Pavel Machek
2015-03-25 20:42             ` Pavel Machek
2015-03-25 21:22               ` Dr. H. Nikolaus Schaller
2015-03-20  7:54 ` [Gta04-owner] [PATCH 0/3] tty slave device support - version 3 Dr. H. Nikolaus Schaller
2015-03-20  8:43   ` NeilBrown
2015-03-20  8:54     ` Dr. H. Nikolaus Schaller
2015-03-20 13:08       ` Sebastian Reichel
2015-03-20 13:57         ` Dr. H. Nikolaus Schaller
2015-03-20 17:14           ` Sebastian Reichel
2015-03-20 19:31 ` Pavel Machek
2015-05-05 19:54 ` Peter Hurley
2015-05-05 20:46   ` NeilBrown
2015-05-06  5:19   ` [Gta04-owner] " Dr. H. Nikolaus Schaller
2015-05-06  9:27     ` Pavel Machek
2015-05-06 11:50       ` Dr. H. Nikolaus Schaller
2015-05-06 12:05         ` Peter Hurley
2015-05-06 12:27           ` Dr. H. Nikolaus Schaller
2015-05-06 12:36             ` Mark Rutland
2015-05-06 13:28               ` Dr. H. Nikolaus Schaller
2015-05-06 14:15                 ` Mark Rutland
2015-05-06 16:09                   ` Dr. H. Nikolaus Schaller
2015-05-06 17:18                     ` Mark Rutland
2015-05-07 12:46                       ` Dr. H. Nikolaus Schaller
2015-05-07 14:30                         ` Peter Hurley
2015-05-07 15:11                           ` Dr. H. Nikolaus Schaller
2015-05-07 16:18                             ` Peter Hurley
2015-05-07 16:57                               ` Dr. H. Nikolaus Schaller
2015-05-07 14:56                         ` Peter Hurley
2015-05-07 15:34                           ` Dr. H. Nikolaus Schaller
2015-05-07 15:51                             ` Peter Hurley
2015-05-07 16:46                               ` Dr. H. Nikolaus Schaller
2015-05-13  8:09                                 ` Dr. H. Nikolaus Schaller
2015-06-03 11:49                                   ` [PATCH RFC 0/3] UART slave device support Dr. H. Nikolaus Schaller
2015-06-06 13:09                                     ` Pavel Machek
     [not found]                                   ` <463356C5-E3C6-432C-A1C5-71F0287F1FEE@goldelico.com>
2015-06-03 12:09                                     ` [Gta04-owner] [PATCH RFC 3/3] misc: Add w2g0004 gps receiver driver Christ van Willegen
2015-05-07 15:37                 ` [Gta04-owner] [PATCH 0/3] tty slave device support - version 3 Peter Hurley
2015-05-06 14:28         ` Pavel Machek
2015-05-06 16:12           ` Dr. H. Nikolaus Schaller
2015-06-06 13:09             ` Pavel Machek
2015-06-06 18:53               ` Belisko Marek
2015-06-06 18:55                 ` Belisko Marek
2015-05-06 11:10     ` Peter Hurley
2015-05-07 15:48     ` Rob Herring

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=20150322144209.14abc603@notabene.brown \
    --to=neilb@suse.de \
    --cc=arnd@arndb.de \
    --cc=devicetree@vger.kernel.org \
    --cc=gnomes@lxorguk.ukuu.org.uk \
    --cc=grant.likely@linaro.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=gta04-owner@goldelico.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=neil@brown.name \
    --cc=pavel@ucw.cz \
    --cc=peter@hurleysoftware.com \
    --cc=sre@kernel.org \
    /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).