From patchwork Thu Nov 2 09:09:17 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roger Quadros X-Patchwork-Id: 117760 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp1910875qgn; Thu, 2 Nov 2017 02:09:30 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TOONHcdgJDmtwqUacOKohpN+/0xKJVput8Z1CwthyD9lMQ3A6yMBrESNuZdmEuGAJQT4ka X-Received: by 10.98.33.203 with SMTP id o72mr3019647pfj.41.1509613770316; Thu, 02 Nov 2017 02:09:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509613770; cv=none; d=google.com; s=arc-20160816; b=qRlnRyQdStwNr7+qeAbf8wuTcsOXH3A4OVl9E8vbAiBdzy4j4kmQxZLEMWiy02Iarl JGK36QxgxVlGwJl+FS/qxvieaGmSjpRFEkg9RZIlaZVCKrwNzftvNz7GO8vNBYQ0sUBo T1rYkCOT6mDjJY4Rq9mVV+pGZnxZ3Ox4+v0yeZhEG6l3X4vpaRPzwAnXEAMCjnywE54H mH0qI69fx9H6Oym4AVeK0MhN2jKemphspB6FROte1zWnNW0v5xyak7YkmfVaTZ5+f0IU 7+T90Y6pKKcHEkyrP4qryhPpkdkErdRWnPBr68de4Y+X1KkFpsIWSUdngrIa8SPIl75z yjxQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:dkim-signature:arc-authentication-results; bh=LmM2PNii0Dmkgy+bxgWknYdxvCBoZ8BQjwHnzdbrA9o=; b=TT9lt3WAF+/4HftEe2d26sYUTgaAYcqrTeOjmZcbjyh+wH33zyor9lxgMHd6XZGI3G 4iNwGhzlDgh7Q/6igWQO+qX3HgAakzmew6B+4iMdJJ+ewvvR4AN7Fd0ZFjnPxX9yogID pEeA5+ljF1au3ewfpUdhIKddRoFM8EFk8EWkbgigFNp9JhGFI4pWQMXd3Vso0LyvurFe Dgf5yKDlcnRZrH07flZ1Duqhax2ZFYDAlDGJIAXGLHr9t44domz1bB0vk1RzxFtiZy2f HYeXr2cYgUsqxpw6NNUJgyNydqioUXMLfm5S/Oj6FlL0NnPmKAJo+vV2anOMgK61nGyn OwZg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lLdUqSMO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u8si1732258plm.73.2017.11.02.02.09.29; Thu, 02 Nov 2017 02:09:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=lLdUqSMO; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755370AbdKBJJ2 (ORCPT + 26 others); Thu, 2 Nov 2017 05:09:28 -0400 Received: from fllnx210.ext.ti.com ([198.47.19.17]:42484 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754859AbdKBJJ1 (ORCPT ); Thu, 2 Nov 2017 05:09:27 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id vA299OYf017009; Thu, 2 Nov 2017 04:09:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1509613764; bh=npoB6Tff93s/5pjMpNTj5nR219Zcrq9MhJ4VWJhpZt0=; h=From:To:CC:Subject:Date; b=lLdUqSMO0F7ggmYA16ZYLZ+ORBpr+sDbVFIUMbwGgBqXvmGkHC54L98J9FNGgNbEh NwP+RtHtWNEXTuh0ODqQ+mAKB9rz3LQ6MNjHnMHIhAn5Za5NIefoaQsojCKGVnEOl3 nJT4xRzL8LE6MnRfF7Y6lC/mUyF8F7ZZFDGdeWfk= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id vA299Oss008274; Thu, 2 Nov 2017 04:09:24 -0500 Received: from DLEE109.ent.ti.com (157.170.170.41) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.1.845.34; Thu, 2 Nov 2017 04:09:21 -0500 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE109.ent.ti.com (157.170.170.41) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.845.34 via Frontend Transport; Thu, 2 Nov 2017 04:09:21 -0500 Received: from dlelxv97.itg.ti.com (dlelxv97.itg.ti.com [172.17.2.193]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id vA299Le5019687; Thu, 2 Nov 2017 04:09:21 -0500 Received: from lta0400828d.ti.com (vboxa0400828d.emea.dhcp.ti.com [172.22.233.136]) by dlelxv97.itg.ti.com (8.14.3/8.13.8) with ESMTP id vA299JFd028715; Thu, 2 Nov 2017 04:09:19 -0500 From: Roger Quadros To: , CC: , , Roger Quadros Subject: [PATCH] USB: dummy-hcd: Adapt dummy_udc_set_speed() Date: Thu, 2 Nov 2017 11:09:17 +0200 Message-ID: <1509613757-4861-1-git-send-email-rogerq@ti.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The UDC core ensures that .udc_set_speed() is called with a speed that is a minimum of the max speeds supported by the gadget function driver and the UDC driver. We can now use the speed argument as is. Get rid of the debug print as that condition will never happen. Signed-off-by: Roger Quadros --- drivers/usb/gadget/udc/dummy_hcd.c | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) -- cheers, -roger Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki. Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki Acked-by: Alan Stern diff --git a/drivers/usb/gadget/udc/dummy_hcd.c b/drivers/usb/gadget/udc/dummy_hcd.c index b17618a..c42ca8e 100644 --- a/drivers/usb/gadget/udc/dummy_hcd.c +++ b/drivers/usb/gadget/udc/dummy_hcd.c @@ -910,20 +910,8 @@ static void dummy_udc_set_speed(struct usb_gadget *_gadget, struct dummy *dum; dum = gadget_dev_to_dummy(&_gadget->dev); - - if (mod_data.is_super_speed) - dum->gadget.speed = min_t(u8, USB_SPEED_SUPER, speed); - else if (mod_data.is_high_speed) - dum->gadget.speed = min_t(u8, USB_SPEED_HIGH, speed); - else - dum->gadget.speed = USB_SPEED_FULL; - + dum->gadget.speed = speed; dummy_udc_update_ep0(dum); - - if (dum->gadget.speed < speed) - dev_dbg(udc_dev(dum), "This device can perform faster" - " if you connect it to a %s port...\n", - usb_speed_string(speed)); } static int dummy_udc_start(struct usb_gadget *g,