linux-serial.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: Max Filippov <jcmvbkbc@gmail.com>
Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org,
	Jiri Slaby <jirislaby@kernel.org>, Arnd Bergmann <arnd@arndb.de>
Subject: Re: [PATCH] serial: add PORT_ANY definition
Date: Sat, 7 Oct 2023 11:17:39 +0200	[thread overview]
Message-ID: <2023100706-circle-rework-993e@gregkh> (raw)
In-Reply-To: <20231006115713.801322-1-jcmvbkbc@gmail.com>

On Fri, Oct 06, 2023 at 04:57:13AM -0700, Max Filippov wrote:
> Current pattern in the linux kernel is that every new serial driver adds
> one or more new PORT_ definitions because uart_ops::config_port()
> callback documentation prescribes setting port->type according to the
> type of port found, or to PORT_UNKNOWN if no port was detected.
> 
> When the specific type of the port is not important to the userspace
> there's no need for a unique PORT_ value, but so far there's no suitable
> identifier for that case.
> 
> Provide generic port type identifier other than PORT_UNKNOWN for ports
> which type is not important to userspace.
> 
> Suggested-by: Arnd Bergmann <arnd@arndb.de>
> Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
> ---
>  include/uapi/linux/serial.h | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/include/uapi/linux/serial.h b/include/uapi/linux/serial.h
> index 53bc1af67a41..070e50cf9e1e 100644
> --- a/include/uapi/linux/serial.h
> +++ b/include/uapi/linux/serial.h
> @@ -47,6 +47,8 @@ struct serial_struct {
>  /*
>   * These are the supported serial types.
>   */
> +/* Generic type identifier for ports which type is not important to userspace. */
> +#define PORT_ANY	(-1)

This should be at the end of the list.

And I think we need a better name, "PORT_GENERIC"?

thanks,

greg k-h

      reply	other threads:[~2023-10-07  9:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-06 11:57 [PATCH] serial: add PORT_ANY definition Max Filippov
2023-10-07  9:17 ` Greg Kroah-Hartman [this message]

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=2023100706-circle-rework-993e@gregkh \
    --to=gregkh@linuxfoundation.org \
    --cc=arnd@arndb.de \
    --cc=jcmvbkbc@gmail.com \
    --cc=jirislaby@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-serial@vger.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).