Re: [PATCH 2/3] usb: roles: intel_xhci: Supplying software node for the role mux

From: Andy Shevchenko
Date: Thu Aug 15 2019 - 08:57:16 EST


On Thu, Aug 15, 2019 at 2:28 PM Heikki Krogerus
<heikki.krogerus@xxxxxxxxxxxxxxx> wrote:
>
> The primary purpose for this node will be to allow linking
> the users of the switch to it. The users will be for example
> USB Type-C connectors. By supplying a reference to this
> node in the software nodes representing the USB Type-C
> controllers or connectors, the drivers for those devices can
> access the switch.

> -static const struct usb_role_switch_desc sw_desc = {
> +static struct usb_role_switch_desc sw_desc = {

I dunno what is better, but usual approach I'm using in other drivers
is to kmemdup() input constant structures in order to have originals
untouched.

--
With Best Regards,
Andy Shevchenko