[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAHp75VctbnJcLdTrGfPju708StpNPzmzTCBb-B-gmKZzOQwteg@mail.gmail.com>
Date: Mon, 28 Jan 2019 11:50:31 +0200
From: Andy Shevchenko <andy.shevchenko@...il.com>
To: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Chen Yu <chenyu56@...wei.com>, Jun Li <jun.li@....com>,
Hans de Goede <hdegoede@...hat.com>,
USB <linux-usb@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/8] usb: typec: Rationalize the API for the muxes
On Fri, Jan 25, 2019 at 3:18 PM Heikki Krogerus
<heikki.krogerus@...ux.intel.com> wrote:
>
> We can replace the second parameter that is passed to the
> typec_mux_get() function with alt mode description
> structure, and simply pass NULL with accessory modes.
>
> With accessory modes there is no need for additional
> identification (in practice the accessory mode can only be
> Audio Accessory if muxing is needed), only with alternate
> modes we need to identify the exact alternate mode.
> +struct typec_mux *typec_mux_get(struct device *dev,
> + const struct typec_altmode_desc *desc)
> {
> struct typec_mux *mux;
>
> mutex_lock(&mux_lock);
> - mux = device_connection_find_match(dev, name, NULL, typec_mux_match);
> + mux = device_connection_find_match(dev, "typec-mux", (void *)desc,
> + typec_mux_match);
Not related to this series, but shouldn't
device_connection_find_match() be improved to avoid dropping const
qualifier?
--
With Best Regards,
Andy Shevchenko
Powered by blists - more mailing lists