[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200302091738.GB22243@kuha.fi.intel.com>
Date: Mon, 2 Mar 2020 11:17:38 +0200
From: Heikki Krogerus <heikki.krogerus@...ux.intel.com>
To: Peter Chen <peter.chen@....com>
Cc: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Benson Leung <bleung@...omium.org>,
Prashant Malani <pmalani@...omium.org>,
Mika Westerberg <mika.westerberg@...ux.intel.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
Felipe Balbi <balbi@...nel.org>,
Chunfeng Yun <chunfeng.yun@...iatek.com>,
Bin Liu <b-liu@...com>
Subject: Re: [PATCH v2 5/9] usb: roles: Provide the switch drivers handle to
the switch in the API
On Mon, Mar 02, 2020 at 06:22:59AM +0000, Peter Chen wrote:
> > > @@ -613,9 +613,10 @@ static enum usb_role ci_usb_role_switch_get(struct device *dev)
> > > return role;
> > > }
> > >
> > > -static int ci_usb_role_switch_set(struct device *dev, enum usb_role role)
> > > +static int ci_usb_role_switch_set(struct usb_role_switch *sw,
> > > + enum usb_role role)
> > > {
> > > - struct ci_hdrc *ci = dev_get_drvdata(dev);
> > > + struct ci_hdrc *ci = usb_role_switch_get_drvdata(sw);
> > > struct ci_hdrc_cable *cable = NULL;
> > > enum usb_role current_role = ci_role_to_usb_role(ci);
> > > enum ci_role ci_role = usb_role_to_ci_role(role);
> > > @@ -1118,6 +1119,7 @@ static int ci_hdrc_probe(struct platform_device *pdev)
> > > }
> > >
> > > if (ci_role_switch.fwnode) {
> > > + ci_role_switch.driver_data = ci;
>
> And chipidea code, better change it like cdns3's, otherwise, the
> switch desc for all controllers have the same driver_data.
That I'll skip after all...
Note that since the context of the switch descriptor is always copied
during registration, the driver_data is not going to be the same for
every switch.
The structure is actually filled in two separate functions, so the
change is not straightforward. We can still change that of course, but
it's out side the scope of this series, so it needs to be done
separately.
thanks,
--
heikki
Powered by blists - more mailing lists