From: Dan Carpenter <dan.carpenter@oracle.com>
To: Haim Daniel <haimdaniel@gmail.com>
Cc: lidza.louina@gmail.com, markh@compro.net,
gregkh@linuxfoundation.org,
driverdev-devel@linuxdriverproject.org,
devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] drivers/staging: refactor dgnc tty registration.
Date: Mon, 15 May 2017 11:44:04 +0300 [thread overview]
Message-ID: <20170515084404.2j62oyyoxn5nc55v@mwanda> (raw)
In-Reply-To: <1494777024-20141-1-git-send-email-haimdaniel@gmail.com>
On Sun, May 14, 2017 at 06:50:24PM +0300, Haim Daniel wrote:
> @@ -129,6 +113,41 @@ static void dgnc_tty_set_termios(struct tty_struct *tty,
>
> /* TTY Initialization/Cleanup Functions */
>
> +static struct tty_driver *__dgnc_tty_register(char *serial_name, uint maxports,
No need for double underscores.
> + int major, int minor)
> +{
> + int rc;
> + struct tty_driver *drv = tty_alloc_driver(maxports,
> + TTY_DRIVER_REAL_RAW |
> + TTY_DRIVER_DYNAMIC_DEV |
> + TTY_DRIVER_HARDWARE_BREAK);
> + if (IS_ERR(drv))
> + return drv;
Blank line between declaration and code. Do it like this:
struct tty_driver *drv;
int rc;
drv = tty_alloc_driver(maxports, TTY_DRIVER_REAL_RAW |
TTY_DRIVER_DYNAMIC_DEV |
TTY_DRIVER_HARDWARE_BREAK);
if (IS_ERR(drv))
return drv;
Also create a matching dgnc_tty_unregister function that does:
static void dgnc_tty_unregister(struct tty_driver *drv)
{
tty_unregister_driver(drv);
put_tty_driver(drv);
}
regards,
dan carpenter
next prev parent reply other threads:[~2017-05-15 8:44 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-14 15:50 Haim Daniel
2017-05-15 8:44 ` Dan Carpenter [this message]
2017-05-15 11:48 ` [PATCH v2] " Haim Daniel
2017-05-15 11:58 ` Dan Carpenter
2017-05-15 12:30 ` [PATCH v3] " Haim Daniel
2017-05-15 12:52 ` Dan Carpenter
2017-05-15 13:49 ` Haim Daniel
2017-05-16 7:51 ` Dan Carpenter
2017-05-15 14:10 ` [PATCH v4] " Haim Daniel
2017-05-16 7:54 ` Dan Carpenter
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=20170515084404.2j62oyyoxn5nc55v@mwanda \
--to=dan.carpenter@oracle.com \
--cc=devel@driverdev.osuosl.org \
--cc=driverdev-devel@linuxdriverproject.org \
--cc=gregkh@linuxfoundation.org \
--cc=haimdaniel@gmail.com \
--cc=lidza.louina@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=markh@compro.net \
/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
all inboxes | Powered by JetHome®