[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170515084404.2j62oyyoxn5nc55v@mwanda>
Date: Mon, 15 May 2017 11:44:04 +0300
From: Dan Carpenter <dan.carpenter@...cle.com>
To: Haim Daniel <haimdaniel@...il.com>
Cc: lidza.louina@...il.com, markh@...pro.net,
gregkh@...uxfoundation.org, driverdev-devel@...uxdriverproject.org,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] drivers/staging: refactor dgnc tty registration.
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
Powered by blists - more mailing lists