From patchwork Thu Jun 9 14:26:05 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johan Hovold X-Patchwork-Id: 12875666 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id E14EAC43334 for ; Thu, 9 Jun 2022 14:26:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343489AbiFIO0e (ORCPT ); Thu, 9 Jun 2022 10:26:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46742 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244864AbiFIO0a (ORCPT ); Thu, 9 Jun 2022 10:26:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B8A46D868; Thu, 9 Jun 2022 07:26:29 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3215BB82E02; Thu, 9 Jun 2022 14:26:28 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id F0D31C3411B; Thu, 9 Jun 2022 14:26:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1654784787; bh=Flt2fNTf33YYN+sp4CP8u8A0ibFdtD0FZot9OODKhMk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Z6Dbrwic5F84F51X07thTu9oMbZDMstjM+01q3iZ7hvl4W6So34zHGBwTY04bVELT KQ3HmjdcYPUbJX84ocs/zCjqF7eHhAZBr+KvZkLSRGo+7S1rY0rfv7+fw5jmLufKSj 3R//aePQBVc3LWUQVS4jQdPaXZUWHeQnMwzM899FVP/fLwQ0puxtrXy290aN0YbxPS 1m+t3t6xcBATTALQqe2pZPEdiW2w4ThXap9FvLFNy7ZXNwc8F03vhC0mZvt3xqTFIP QExUthrDaSDOwVQRGoOrTCK49wHqswfEn4fnHN/qnlKom7/lAPvMCU1CvrNjO5s8c7 0fa8cRvGwBeOA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1nzJ79-00069P-Fc; Thu, 09 Jun 2022 16:26:23 +0200 From: Johan Hovold To: Mauro Carvalho Chehab , Hans Verkuil Cc: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org, Johan Hovold Subject: [PATCH 3/3] media: flexcop-usb: use usb_endpoint_maxp() Date: Thu, 9 Jun 2022 16:26:05 +0200 Message-Id: <20220609142605.23620-4-johan@kernel.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220609142605.23620-1-johan@kernel.org> References: <20220609142605.23620-1-johan@kernel.org> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org Use the usb_endpoint_maxp() helper instead of open coding. Signed-off-by: Johan Hovold --- drivers/media/usb/b2c2/flexcop-usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/media/usb/b2c2/flexcop-usb.c b/drivers/media/usb/b2c2/flexcop-usb.c index 7102b346db05..790787f0eba8 100644 --- a/drivers/media/usb/b2c2/flexcop-usb.c +++ b/drivers/media/usb/b2c2/flexcop-usb.c @@ -430,7 +430,7 @@ static int flexcop_usb_transfer_init(struct flexcop_usb *fc_usb) int bufsize, i, j, ret; int buffer_offset = 0; - frame_size = le16_to_cpu(alt->endpoint[0].desc.wMaxPacketSize); + frame_size = usb_endpoint_maxp(&alt->endpoint[0].desc); bufsize = B2C2_USB_NUM_ISO_URB * B2C2_USB_FRAMES_PER_ISO * frame_size; deb_ts("creating %d iso-urbs with %d frames each of %d bytes size = %d.\n",