[PATCH 2/3] staging: most: hdm-usb: do h/w specific synchronization at configuration time
Dan Carpenter
dan.carpenter at oracle.com
Wed Oct 26 14:22:50 UTC 2016
On Tue, Oct 25, 2016 at 05:44:20PM +0200, Christian Gromm wrote:
> From: Andrey Shvetsov <andrey.shvetsov at k2l.de>
>
> This patch puts the synchronization procedure trigger for asynchronous
> channels into the function hdm_configure_channel. Likewise, it removes
> triggering of hardware specific synchronization for other channel types
> from the probe function as it is not required.
>
> Signed-off-by: Andrey Shvetsov <andrey.shvetsov at k2l.de>
> Signed-off-by: Christian Gromm <christian.gromm at microchip.com>
> ---
> drivers/staging/most/hdm-usb/hdm_usb.c | 17 +++++++++--------
> 1 file changed, 9 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/staging/most/hdm-usb/hdm_usb.c b/drivers/staging/most/hdm-usb/hdm_usb.c
> index 1a630e1..db11930 100644
> --- a/drivers/staging/most/hdm-usb/hdm_usb.c
> +++ b/drivers/staging/most/hdm-usb/hdm_usb.c
> @@ -695,6 +695,15 @@ static int hdm_configure_channel(struct most_interface *iface, int channel,
> - conf->buffer_size;
> exit:
> mdev->conf[channel] = *conf;
> + if (conf->data_type == MOST_CH_ASYNC) {
> + u16 ep = mdev->ep_address[channel];
> + int err = drci_wr_reg(mdev->usb_device,
> + DRCI_REG_BASE + DRCI_COMMAND + ep * 16,
> + 1);
> +
> + if (err < 0)
> + dev_warn(dev, "sync for ep%02x failed", ep);
> + }
> return 0;
This code is weird, because we goto exit without checking the
frame_size. It looks like it doesn't matter much but it's sort of
puzzling what's going on. There weren't any comments to explain it.
regards,
dan carpenter
More information about the devel
mailing list