Re: [PATCH 06/20] bus: mhi: ep: Add support for registering MHI endpoint client drivers
From: Manivannan Sadhasivam
Date: Thu Feb 03 2022 - 09:53:26 EST
On Wed, Jan 05, 2022 at 06:27:33PM -0600, Alex Elder wrote:
> On 12/2/21 5:35 AM, Manivannan Sadhasivam wrote:
> > This commit adds support for registering MHI endpoint client drivers
> > with the MHI endpoint stack. MHI endpoint client drivers binds to one
> > or more MHI endpoint devices inorder to send and receive the upper-layer
> > protocol packets like IP packets, modem control messages, and diagnostics
> > messages over MHI bus.
> >
> > Signed-off-by: Manivannan Sadhasivam <manivannan.sadhasivam@xxxxxxxxxx>
> > ---
> > drivers/bus/mhi/ep/main.c | 85 +++++++++++++++++++++++++++++++++++++++
> > include/linux/mhi_ep.h | 53 ++++++++++++++++++++++++
> > 2 files changed, 138 insertions(+)
> >
> > diff --git a/drivers/bus/mhi/ep/main.c b/drivers/bus/mhi/ep/main.c
> > index db664360c8ab..ce0f99f22058 100644
> > --- a/drivers/bus/mhi/ep/main.c
> > +++ b/drivers/bus/mhi/ep/main.c
> > @@ -193,9 +193,88 @@ void mhi_ep_unregister_controller(struct mhi_ep_cntrl *mhi_cntrl)
> > }
> > EXPORT_SYMBOL_GPL(mhi_ep_unregister_controller);
> > +static int mhi_ep_driver_probe(struct device *dev)
> > +{
> > + struct mhi_ep_device *mhi_dev = to_mhi_ep_device(dev);
> > + struct mhi_ep_driver *mhi_drv = to_mhi_ep_driver(dev->driver);
> > + struct mhi_ep_chan *ul_chan = mhi_dev->ul_chan;
> > + struct mhi_ep_chan *dl_chan = mhi_dev->dl_chan;
> > +
>
> Either ul_chan or dl_chan must be set, right? Check this.
> Otherwise I think this looks OK.
>
done
> -Alex
>
> > + if (ul_chan)
> > + ul_chan->xfer_cb = mhi_drv->ul_xfer_cb;
> > +
> > + if (dl_chan)
> > + dl_chan->xfer_cb = mhi_drv->dl_xfer_cb;
> > +
> > + return mhi_drv->probe(mhi_dev, mhi_dev->id);
> > +}
>
> . . .