[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YXgZ0N/eWmmXeoP2@kroah.com>
Date: Tue, 26 Oct 2021 17:08:00 +0200
From: Greg KH <gregkh@...uxfoundation.org>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc: Prashant Malani <pmalani@...omium.org>,
Benson Leung <bleung@...gle.com>,
Adam Thomson <Adam.Thomson.Opensource@...semi.com>,
Guenter Roeck <linux@...ck-us.net>,
Badhri Jagan Sridharan <badhri@...gle.com>,
Jack Pham <jackp@...eaurora.org>,
"Gopal, Saranya" <saranya.gopal@...el.com>,
"Regupathy, Rajaram" <rajaram.regupathy@...el.com>,
linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 2/4] usb: typec: Character device for USB Power
Delivery devices
On Tue, Oct 26, 2021 at 05:33:50PM +0300, Heikki Krogerus wrote:
> Interim.
>
> TODO/ideas:
> - Figure out a proper magic value for the ioctl and check if
> the ioctl range is OK.
> - Register separate PD device for the cdev, and register it
> only if the device (port, plug or partner) actually
> supports USB PD (or come up with some other solution?).
> - Introduce something like
>
> struct pd_request {
> struct pd_message request;
> struct pd_message __user *response;
> };
>
> and use it instead of only single struct pd_messages everywhere.
>
> - Add compat support.
Ick, no, new ioctls should never need compat support if you create them
properly. That is only for "old" ones.
Also, why not use the miscdev api instead? That should remove some code
of yours and make things simpler, if you really want to stick with a
char device node...
thanks,
greg k-h
Powered by blists - more mailing lists