From patchwork Wed Jul 1 06:19:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635389 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DFAF3913 for ; Wed, 1 Jul 2020 06:23:52 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C2A4D2074D for ; Wed, 1 Jul 2020 06:23:52 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="YYI9vgHH"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="lUZTHtt1" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727808AbgGAGXT (ORCPT ); Wed, 1 Jul 2020 02:23:19 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:45098 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726615AbgGAGXO (ORCPT ); Wed, 1 Jul 2020 02:23:14 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616Ff4F012562; Tue, 30 Jun 2020 23:22:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=xZto3yDE74aRxXazV/yNAF+o9WnIWRMTIfRYscNdEWA=; b=YYI9vgHHw38REwRojmMzxW/TqFNuTGtySHTx7O89h6tquql/BRVKDbLbJUvwfLfcN0r9 ZcfezP6xCT3X+7owS4jKy4a6tlp6VPAs3F2LpBRDaodmQx6CwQJMpAZFO9VWFBeCBTES lktnOgw+4wvvkt2e9IKeBjmLBpwlLi+7LTCLbfWw5BD74jraWw5n3Zd+2VoY2KaHZR9G 6ou3EhhSYRIqRdGEFp/zL+JzEwxK1lglcRdcsI5j4RLUhwtFxBtYhLTeFiQdE6/zMalG Ogef2B0rKerfC3FYfikTld8nDxCMRaG/S2xPNEKil7k0vOgUQJMfV99S/GVrfVS1OYn5 4w== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2176.outbound.protection.outlook.com [104.47.55.176]) by mx0b-0014ca01.pphosted.com with ESMTP id 31x1pyq6s4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CFdyeJ4aPd9BYQv7J7mCy6BEpoQOXV84yh+HpvEl1WvblViFA8pfTw6Gk47JJORBM150fz0OUpFBR4OcVjh33/U+bNxzKvHTpPOM1WhL9DZ5jh1Xs1INFQgi7z4VMMq+yPqjZkL/2DGuhCjwNybAHz+udpUoUkhFArGDDEDEjqzhymUOt5uNxNc2HymEayIWXkW5fjffMiHq+M+7km5PgiXS7ueHmogS4NJOSh3pEi88uZqqWbEVF2Q2/Hej6FssWSLnpXUIFkwH/tnbXqwCMu13W47BclJFd8FsTH6l1tvCjDqrIxYgG/c9DMmduLnLoyw0xvxZoLW46CE3DeeiZQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xZto3yDE74aRxXazV/yNAF+o9WnIWRMTIfRYscNdEWA=; b=BxB5ZR/Fws4bveliMnygoSNUkY2kZfg+FiNPcc3X2IrxAcfGkPt/AlNgBzISJXRbKku7junSnBmSXkQIvzDbVASsvpXR/Iy2hJgVUbnnK6WsZam7hszJWt3JkESU86zflUyl6hgBhVrvNCHVpv8OracsH5inLtSiV4cnNVtUJty/zszJw5WqKKgiLcUkR4jzDeUZeew2pSpji0IdarYmkW2ENcIXCQkQ6HkYvwBeOUmluDMuTZcxYOj0jXGfQKkBhkio1hduS1tI4jg9/fIiS9jS+heMzw4Fhr4A6XCvE31vcjRqlShvz8DtxSM1AyOcXqRV0W9ykpm34XvF3vRgOQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=xZto3yDE74aRxXazV/yNAF+o9WnIWRMTIfRYscNdEWA=; b=lUZTHtt1f791XUbMqu7PPib1WLCx4SXUGVK7yM0GYBCrip2TsVLHAxvayHtfgryMFGqcqwGTlBR3NwLHdIN91jyqQ8s+94H2i4rpLYRRhoeeVU+rdS0VCqqQ7jrFlsA6BBD+h9mBIT6uzVqnmb+apaFRflhXThAMtH8G1lkjB04= Received: from BN1PR12CA0012.namprd12.prod.outlook.com (2603:10b6:408:e1::17) by MW2PR07MB4121.namprd07.prod.outlook.com (2603:10b6:907:9::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Wed, 1 Jul 2020 06:22:51 +0000 Received: from BN8NAM12FT007.eop-nam12.prod.protection.outlook.com (2603:10b6:408:e1:cafe::53) by BN1PR12CA0012.outlook.office365.com (2603:10b6:408:e1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20 via Frontend Transport; Wed, 1 Jul 2020 06:22:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT007.mail.protection.outlook.com (10.13.182.76) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.17 via Frontend Transport; Wed, 1 Jul 2020 06:22:48 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiN092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:47 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:44 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:44 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616Miel030583; Wed, 1 Jul 2020 08:22:44 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616Mihw030582; Wed, 1 Jul 2020 08:22:44 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 1/9] usb: cdns3: Improvement: removed cdns3_get_current_role_driver function. Date: Wed, 1 Jul 2020 08:19:56 +0200 Message-ID: <20200701062004.29908-2-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(136003)(376002)(346002)(396003)(36092001)(46966005)(2906002)(70206006)(107886003)(8936002)(7416002)(70586007)(8676002)(4326008)(186003)(336012)(2616005)(110136005)(26005)(316002)(42186006)(54906003)(36906005)(426003)(478600001)(5660300002)(1076003)(4744005)(81166007)(83380400001)(36756003)(82310400002)(47076004)(356005)(82740400003)(6666004)(86362001);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 406bbf3b-4454-44fe-5622-08d81d872d36 X-MS-TrafficTypeDiagnostic: MW2PR07MB4121: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pH8K0I+MdC6npA0cxFHKTQajswmWS+tQQO6JQU+AMyZ1styOsvvxNwN62uVcIiHK/TAK7UEa82kcywTpWQhK795hV10c0N/zQ0eOoWHncmPpQyX/q060iGj4eUIe0g9DPhARzyuxPX2DFbHTdkaUO1ujHUNK+uGx15WZhz0hmOTtx3BdMer21sqvouuaJLopCh8cUooZWSwgRsZ3aTn+1yYXQiZ3BpFnxtOct7LPNHqUm7uE0yTr8j3v63qDr11TvQDlsdLL1u5+EEX+GWQlGNNpg3uVTUrZi6mZrkURI8/4MdoejaJiZYaQVu1wn9TuyTYjYlAupHN/bxx96NIwaYBOqBAxIKDgZU3GbKuLukL8x1ZmGcHPwNnLRJ/tvHCTessqvdA+sJZlUMJhOx+b6tvQqiWx7eGn/IFd5pDRnZk= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:48.7722 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 406bbf3b-4454-44fe-5622-08d81d872d36 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT007.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW2PR07MB4121 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 phishscore=0 malwarescore=0 cotscore=-2147483648 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 mlxlogscore=711 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Function is not used in driver so it can be removed. Signed-off-by: Pawel Laszczak Reviewed-by: Peter Chen --- drivers/usb/cdns3/core.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 19bbb5b7e6b6..eaafa6bd2a50 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -27,13 +27,6 @@ static int cdns3_idle_init(struct cdns3 *cdns); -static inline -struct cdns3_role_driver *cdns3_get_current_role_driver(struct cdns3 *cdns) -{ - WARN_ON(!cdns->roles[cdns->role]); - return cdns->roles[cdns->role]; -} - static int cdns3_role_start(struct cdns3 *cdns, enum usb_role role) { int ret; From patchwork Wed Jul 1 06:19:57 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635391 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5EFED618 for ; Wed, 1 Jul 2020 06:24:21 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3BDB920663 for ; Wed, 1 Jul 2020 06:24:21 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="pZr97A89"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="vX7Z3h7t" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727909AbgGAGYP (ORCPT ); Wed, 1 Jul 2020 02:24:15 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:61930 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727051AbgGAGYO (ORCPT ); Wed, 1 Jul 2020 02:24:14 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616FbUW012536; Tue, 30 Jun 2020 23:22:53 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=kKWh4NEvAqTMFpxq9hIhC22mjHpeqWZCikNnAE1CP6s=; b=pZr97A89yV0MSYpqMSVSX9cZOMpFx4AJ2IVJhlk814B2fypmZs8Ep3eEgYqsFTFRQK92 Fje55Yj8Xi6zcwiT7LGGSF7s6GgqO/bWEDAr321NtwsNoPaxYe2NVNiBiXvAeyWJmfb4 uNMkolaLVEVXq4gVQw411Wg398IM7lOfHDUg+wLXlY/Re8xXS5d/RuVxrNO0GS1R3Ybv SCxLSX+lkriwxC/5FrhwixmrvR+F63llalP1KxnSZhtYadDYBe5F2qFvuyrDTnKYEufZ RpI0rf6W2FpZIYsG4TS0InqMdmU779ZyG8AUf1ACkiQJ8bsdfsrlhy7WyrB5+4F5WIO8 Rw== Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2171.outbound.protection.outlook.com [104.47.58.171]) by mx0b-0014ca01.pphosted.com with ESMTP id 31x1pyq6s2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:53 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bxymTz8XBG06cc4LkBnBP6djBxRFjX7ntFmXfVRUOI1bP2wAPSnm0GEp7g7+P9cBC16PPiRgA+femx9HURNd3G8ohQP10tFEBYoxwUcuunQfkU5zoDIt5MM7ZS8b8LTMjQy7ggiHGl/bdpYyZraNB/rj3aO+x8vgNDX9xCUvk6jHJ8ts3WofMixbaeAYOMYDZRbIfzCMSMoul3zfikiuDFEbz+GmKtJvibevYXDeOZASa8UCl9YRIocg9CyuDol+RWAIKdh5pNtD5Q44bV80mhA/roOoMk7FdZOjdYmgaMPIMbZwfQjT6MvNidAf/aL3fJ/Bre3iv5lbOXecefn7XQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kKWh4NEvAqTMFpxq9hIhC22mjHpeqWZCikNnAE1CP6s=; b=QM11GT37UF3rG3iN5wj181okOnqA0yf7E/7lERpCIqd17L7Si6vNYkpty0YXsZNV7kbvcCn230R9MLHzvOF1zyjdZgAFHVsp9jZtvKrSL42KRuQyY9MxG8hNzvSo8G/9iKTutXbgEJ6iiIxvZTetVW5j3CaO1bGj3RPGjQVIYR9HkW/l34D6ij2AYIMuzEfIFiasu9RaESkUGVOGPR0xQZ1L3LBeUsrkcdvJTX1nW0Lf2av2Y+r0s0iDTAMXk1Hk5m4AHNKWScUajlPfxmfbeU2detwfb2Izc/CLkoqZnHp8WrceHcdvVSprfYjQKhoOB1P+y0PK4KS6XGU7p3pwlQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kKWh4NEvAqTMFpxq9hIhC22mjHpeqWZCikNnAE1CP6s=; b=vX7Z3h7ts2xB+bDhHnLuM6eTQ5AO3L5Y6qRJP2o5rlV6AOeTrkHfc6bZ2O/CtStfwthZZ/Cp4wD7C13I4tjfaekX5BaJZ4BNMSslf/ZaDxFYIfZ+t1I7bQDs3hGmAHZgBRUuPHg4JYskh3LUeKWiwIn9qMy8L2mZgEAnOes4kgk= Received: from BN6PR11CA0002.namprd11.prod.outlook.com (2603:10b6:405:2::12) by BLAPR07MB7539.namprd07.prod.outlook.com (2603:10b6:208:296::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.26; Wed, 1 Jul 2020 06:22:51 +0000 Received: from BN8NAM12FT021.eop-nam12.prod.protection.outlook.com (2603:10b6:405:2:cafe::f4) by BN6PR11CA0002.outlook.office365.com (2603:10b6:405:2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20 via Frontend Transport; Wed, 1 Jul 2020 06:22:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT021.mail.protection.outlook.com (10.13.183.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.10 via Frontend Transport; Wed, 1 Jul 2020 06:22:49 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiP092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:48 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616MjIa030587; Wed, 1 Jul 2020 08:22:45 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616MjTF030586; Wed, 1 Jul 2020 08:22:45 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 2/9] usb: cdns3: Improvement: removed not needed variables initialization Date: Wed, 1 Jul 2020 08:19:57 +0200 Message-ID: <20200701062004.29908-3-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(376002)(39860400002)(346002)(36092001)(46966005)(47076004)(82310400002)(8936002)(7416002)(186003)(107886003)(4326008)(5660300002)(36756003)(426003)(336012)(1076003)(8676002)(26005)(6666004)(83380400001)(54906003)(2906002)(70206006)(70586007)(86362001)(81166007)(356005)(82740400003)(36906005)(2616005)(110136005)(478600001)(42186006)(316002);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 45866955-7e99-451f-ad64-08d81d872ddd X-MS-TrafficTypeDiagnostic: BLAPR07MB7539: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:160; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Wlp2ypGgyacPOSlyZQDhKbzoVFZhaPQpbQyAH4zofbHaZXYD/XBKrsg7PtQG+XfdK1TaNAbKm4qmMKdL3BbXxMAvjsm40TkqJcga6aHFCfpc8fQiyav26Qd02ulvKVzuYEFqtfd0eeBzLkU8yICEI3yyYnCGj/A3eW343rI20wtPJgFSwtcyNx0eiuMNebgpdkyAb4EELMUd+YwDzKpaVUwDMRD6QPreiONNQH27LI11QE9sqDmnKC/FFDSHmZ5woEePSVLFFYq5zuzvcT5K/fPybOi0K3J3PzDcSNbiAyJ6PsD6bSQP2gFXdJmVBdJD4+zQB9C+D/W9yIFg5rJc1e0gvYshsrEoL59+4i6q+HV71Exu82wW88OcW5j+o6pNEg30cxw6oCdP/g02rakpdnKKJZyV1xhjQzTmn+crWjg= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:49.8679 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 45866955-7e99-451f-ad64-08d81d872ddd X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT021.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR07MB7539 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 phishscore=0 malwarescore=0 cotscore=-2147483648 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 mlxlogscore=614 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Patch remove some variables initialization from core.c and drd.c file. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/core.c | 4 ++-- drivers/usb/cdns3/drd.c | 19 +++++++++---------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index eaafa6bd2a50..c3dac945f63d 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -86,7 +86,7 @@ static int cdns3_core_init_role(struct cdns3 *cdns) struct device *dev = cdns->dev; enum usb_dr_mode best_dr_mode; enum usb_dr_mode dr_mode; - int ret = 0; + int ret; dr_mode = usb_get_dr_mode(dev); cdns->role = USB_ROLE_NONE; @@ -177,7 +177,7 @@ static int cdns3_core_init_role(struct cdns3 *cdns) goto err; } - return ret; + return 0; err: cdns3_exit_roles(cdns); return ret; diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c index 58089841ed52..4939a568d8a2 100644 --- a/drivers/usb/cdns3/drd.c +++ b/drivers/usb/cdns3/drd.c @@ -29,7 +29,6 @@ */ int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode) { - int ret = 0; u32 reg; switch (mode) { @@ -61,7 +60,7 @@ int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode) return -EINVAL; } - return ret; + return 0; } int cdns3_get_id(struct cdns3 *cdns) @@ -134,11 +133,11 @@ static void cdns3_otg_enable_irq(struct cdns3 *cdns) int cdns3_drd_switch_host(struct cdns3 *cdns, int on) { int ret, val; - u32 reg = OTGCMD_OTG_DIS; /* switch OTG core */ if (on) { - writel(OTGCMD_HOST_BUS_REQ | reg, &cdns->otg_regs->cmd); + writel(OTGCMD_HOST_BUS_REQ | OTGCMD_OTG_DIS, + &cdns->otg_regs->cmd); dev_dbg(cdns->dev, "Waiting till Host mode is turned on\n"); ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val, @@ -212,7 +211,7 @@ int cdns3_drd_switch_gadget(struct cdns3 *cdns, int on) */ static int cdns3_init_otg_mode(struct cdns3 *cdns) { - int ret = 0; + int ret; cdns3_otg_disable_irq(cdns); /* clear all interrupts */ @@ -223,7 +222,8 @@ static int cdns3_init_otg_mode(struct cdns3 *cdns) return ret; cdns3_otg_enable_irq(cdns); - return ret; + + return 0; } /** @@ -234,7 +234,7 @@ static int cdns3_init_otg_mode(struct cdns3 *cdns) */ int cdns3_drd_update_mode(struct cdns3 *cdns) { - int ret = 0; + int ret; switch (cdns->dr_mode) { case USB_DR_MODE_PERIPHERAL: @@ -307,8 +307,8 @@ static irqreturn_t cdns3_drd_irq(int irq, void *data) int cdns3_drd_init(struct cdns3 *cdns) { void __iomem *regs; - int ret = 0; u32 state; + int ret; regs = devm_ioremap_resource(cdns->dev, &cdns->otg_res); if (IS_ERR(regs)) @@ -359,7 +359,6 @@ int cdns3_drd_init(struct cdns3 *cdns) cdns3_drd_thread_irq, IRQF_SHARED, dev_name(cdns->dev), cdns); - if (ret) { dev_err(cdns->dev, "couldn't get otg_irq\n"); return ret; @@ -371,7 +370,7 @@ int cdns3_drd_init(struct cdns3 *cdns) return -ENODEV; } - return ret; + return 0; } int cdns3_drd_exit(struct cdns3 *cdns) From patchwork Wed Jul 1 06:19:58 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635377 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id DD082913 for ; Wed, 1 Jul 2020 06:23:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BA17320775 for ; Wed, 1 Jul 2020 06:23:20 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="Ti96LA5T"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="c4kTMI28" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727827AbgGAGXU (ORCPT ); Wed, 1 Jul 2020 02:23:20 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:21184 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbgGAGXQ (ORCPT ); Wed, 1 Jul 2020 02:23:16 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616H9GJ014532; Tue, 30 Jun 2020 23:22:55 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=qVUi0yl+qIKCwHrcuhRPVPyw5qHBBBzSwFgBYXpfC88=; b=Ti96LA5TJg3p+sNyPtq57pjSShSdS16cOWKFOeCPAyY8OzrM+RlDsaH8S1nhOkOfeGU6 bb8J1OMhhnWq5JWq8seV+2WFwYUd0hniNZLxQ68ZwMImbpXDUESaBCU1B9Ak4M0YZriM kUyT9ZuVDPG8D907i4vlQQ3QrtVFv4Xlmg/WLET5WpI3444R8plZ/tWjpEGIFZTvL/Wv uV0oJq1ih/d9I/iV20wVOgqPn44xwQecinWIXsCFeO8L9MagAFOWK6aWmoaBeTk8KCYR jBdkpHqo4slLNI3OXvHgO43Kgodwkrijbia8IMYUV3ICjunVAjlE9i1jQkFMyqMk2gNq 6w== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2048.outbound.protection.outlook.com [104.47.66.48]) by mx0a-0014ca01.pphosted.com with ESMTP id 31x2nxxa8c-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TbZysMvCqnkv3x2exnUB+26+2fNvLBXevBArztHKvH6gru47aIa1ZI2/Jf/9BO4qZuaPMYri5sHcfFnXexiCzw8632Fn83pCd9ibxz/19oM/B5McOfLy5hE+uQF2NQ8BJu5dId8HFAtocnG8zSz9erHcE6ZNMpagM/rjj+iLzzxnYMdEKUhjXdpHk6D5wS/A8FMlY6SpF22RfwGDEJbe1KfaU0B7Qd3sbEfCziVuwYlo3D9nfIntMVD78Lqx2IS+qd0zK8I8Ty+TNlzeJ/15CftWk0PZUSOQjUYjbKBfgDrjJSL07tdjhsdEU/NWvEfDKWISCLIPAY5TpMGdoKE8Qg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qVUi0yl+qIKCwHrcuhRPVPyw5qHBBBzSwFgBYXpfC88=; b=XZoT3y/4GmaBYUhIiI5UpE26Zf5oJE2ma5St9PqliorxaPSB570ABURVCmPvD41JCAMT/8un7dpJdyK6M29WAxBxV7qPJHfSNMURAFcvZ13MHft90IoNgJrsoLhL6fJrXV4GZ6Zb3pMFFCg9ZMViNq4iu5Q9x4FrpyIj0c+rBLg9OkxSdB1HEQJjcqRy0/dauYl1H3L1+QCfapWJ4J/IyNbRHYvyqYKor/rlRIxB0hHCzSB8UaPcjA5JAHsPpenV2NRx0WUkdzOKYE6c5iT0X16hGof1iyCwpC1/UDmZjc7tRIEE0LBzFMg5oYDCgj2Gp7wL1NB2pSPbUO2XqZHSRw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=qVUi0yl+qIKCwHrcuhRPVPyw5qHBBBzSwFgBYXpfC88=; b=c4kTMI28dsniDehUmE0/oBK9Zg77A6HJxkOd6geZHuEwf09KJI/dMveYkhdWm7aznCGiw7ckQA74ux6o2qnLUt5ahllWfSv4FFioG/67BfhYqKawEZEY4fBasPtVAQg0qI7xdGgMJDx0aLgd1c28c9DFLA1J6N8jH2tjancwcHA= Received: from BN6PR17CA0006.namprd17.prod.outlook.com (2603:10b6:404:65::16) by CY4PR0701MB3811.namprd07.prod.outlook.com (2603:10b6:910:8c::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.25; Wed, 1 Jul 2020 06:22:53 +0000 Received: from BN8NAM12FT015.eop-nam12.prod.protection.outlook.com (2603:10b6:404:65:cafe::9f) by BN6PR17CA0006.outlook.office365.com (2603:10b6:404:65::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20 via Frontend Transport; Wed, 1 Jul 2020 06:22:51 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT015.mail.protection.outlook.com (10.13.183.188) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.17 via Frontend Transport; Wed, 1 Jul 2020 06:22:49 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiO092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:48 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616Mjfn030592; Wed, 1 Jul 2020 08:22:45 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616Mjx5030591; Wed, 1 Jul 2020 08:22:45 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 3/9] usb: cnds3: Improvement: deleted != Date: Wed, 1 Jul 2020 08:19:58 +0200 Message-ID: <20200701062004.29908-4-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39860400002)(376002)(346002)(396003)(36092001)(46966005)(1076003)(70586007)(70206006)(8936002)(2906002)(26005)(4744005)(54906003)(110136005)(82310400002)(36756003)(47076004)(336012)(36906005)(4326008)(186003)(356005)(6666004)(83380400001)(5660300002)(86362001)(426003)(8676002)(82740400003)(478600001)(42186006)(316002)(107886003)(81166007)(7416002)(2616005);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 934ff23b-0e5a-4dd1-97a5-08d81d872da3 X-MS-TrafficTypeDiagnostic: CY4PR0701MB3811: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:820; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: P5Jj4VdyywmabQN5SiT3l8LgzC5SCes76q8XW1/X/W6gyeMXHqHcBICIrvFVs/SMskYwF1Ofd2mIb9mAqPQpIeg4nQnMpfTMYQUSCebLOdF9oE8KAfVV+IIpuKvR3WbXNGFStqC9l/EMbaz8N7KjijToObCBweZM3TW4zXvqYbssBB5VNNFOviVG3ImMbWYvBaP4CZnRedvagP6BEneaeMncI7esSHoQjRKD6HbULMD8td6Bf0yqlusq9Gn0BdUxj/JmdS9/6LyICbKxQ07lpTHoGyl0ZP6h4vgevjBn4/Mpi9CK+In54zcN/o3y91cOb4DXa+GSQg0eQDxII7mFPBKi0+HUTN0VQDF+dt8HoDMQ8bjhR+0kpWQjWibE57L18hp021FlrcKg58/zxjRup+yJdgyjAD12ip53IIqc94k= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:49.4802 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 934ff23b-0e5a-4dd1-97a5-08d81d872da3 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT015.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR0701MB3811 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 phishscore=0 cotscore=-2147483648 mlxlogscore=835 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Patch deletes unnecessary != from condition statement ini cdns3_drd_init function. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/drd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c index 4939a568d8a2..6d2da504ad49 100644 --- a/drivers/usb/cdns3/drd.c +++ b/drivers/usb/cdns3/drd.c @@ -365,7 +365,7 @@ int cdns3_drd_init(struct cdns3 *cdns) } state = readl(&cdns->otg_regs->sts); - if (OTGSTS_OTG_NRDY(state) != 0) { + if (OTGSTS_OTG_NRDY(state)) { dev_err(cdns->dev, "Cadence USB3 OTG device not ready\n"); return -ENODEV; } From patchwork Wed Jul 1 06:19:59 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635381 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 688F8618 for ; Wed, 1 Jul 2020 06:23:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 4344120722 for ; Wed, 1 Jul 2020 06:23:36 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="REGtuz6c"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="apVCGlM3" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727848AbgGAGXZ (ORCPT ); Wed, 1 Jul 2020 02:23:25 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:53172 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727838AbgGAGXW (ORCPT ); Wed, 1 Jul 2020 02:23:22 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616HCex014542; Tue, 30 Jun 2020 23:22:56 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=rdQONh4CY1EV94jM0VuQyufyzyyqDd27dwJDoPPf5Ro=; b=REGtuz6cECBR3IxLAB9FyIToHGf7gvuT9QSnl6BOSWQ1dRGttMNGJCGSOSwXVJM2+MB/ 6w/o9BM/HAGjyRd+mYNXCuGOP78Zft4ZQ3lgO/wj7AJBJ2Vdm4mdKUijRvCAl/P5CLS2 6hsVf69loqpdTCo8JX+9m2kq2O5xMWTTf5zrxt0wT6in/CTygSVANM7zw4Q8rjZpVqCE xQO30ibgUFIW7XXNe4G5pBnw/FaWMRFw3TPZsqaLZXv/FB+ovxtv/Y3k3lP+WX1dpzl9 0a2+O2uBBO9aeF9u1EEej4mToXgj5kX3OSJFAWKEOor4xDo6almcsFlPqZH8AhYc3/le jA== Received: from nam04-sn1-obe.outbound.protection.outlook.com (mail-sn1nam04lp2055.outbound.protection.outlook.com [104.47.44.55]) by mx0a-0014ca01.pphosted.com with ESMTP id 31x2nxxa8a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:55 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=CRAMi+cHDpS9G6uGNYitX7P8QX9q23BqHhY62BqTLFZ7NTEladwS/FKB3bDH5CqHL9bFNeIK+lYFyQC8nFWKniAHPwnm58XNdugrXgk+hOtIggbqWQe2vkaNlIdWxQMwjD8MQrVpeV7IzEge2paAf17tKEiR606un/HrxTOrFkccGS5WuRMjLIfpiqWf/cmIzJNlEfOdP9H9Q8tVrjkEXqDuhvRo7AcIDy9f3BOOgC09H5wyX6hoQg48x+LUXGyVrDOKzJNeyuBFB5T1O2U41wtBl1iurDhDiM8achT9iFzyYzURFHF+xdWmVXZTOGGlwAuyMspx2Ck1BSIjU612Tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rdQONh4CY1EV94jM0VuQyufyzyyqDd27dwJDoPPf5Ro=; b=SyKMjCa6te7wWeb35xgqD88ZpjmdbK80lw8KtF4PR51zi852XgyTLJlZrpDH3A8m6G2zx5YV7x/inw/Zfor49ERWrnGbnvAKIL90NZ0cTbVMDOwZW6Crol5OSufAmUxxqdxQT9bvxCawRgANmrMKE6yGGFgjpatK0HAA+IiSWt4bcDNz2oyTLE0dMgWTN03kvA2fydNY9PLhXUypX3h5Z2CrOOCwstCH+ZJLFoUaDsG3DhNZUOEkiHsqZp4e5lnDP9QjkQqyaBymoGKqrTMVIJAwYhVz8m2h+nFo5IcLzWZhvWV3SZFvVKBCQ9BZn5eXOsUK/g6YRqxY+IX9tHDUOA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=rdQONh4CY1EV94jM0VuQyufyzyyqDd27dwJDoPPf5Ro=; b=apVCGlM3QbC+fcjyjCvXg2qKJCPs29a6m54U1HxOiwUai6Ebo7De/ASBLmT4IU6LHDE1MzXOa8PlOiinBDk5JK5h4OwTByvTdg79yB2TPxaVLr2ddhngdJQ33LnaCPrtqRaReB5fPZ7fjbN5+cmzexnptSDDQ6P47fRjEOLTS3s= Received: from BN6PR08CA0053.namprd08.prod.outlook.com (2603:10b6:404:b9::15) by CH2PR07MB6456.namprd07.prod.outlook.com (2603:10b6:610:23::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.25; Wed, 1 Jul 2020 06:22:53 +0000 Received: from BN8NAM12FT053.eop-nam12.prod.protection.outlook.com (2603:10b6:404:b9:cafe::48) by BN6PR08CA0053.outlook.office365.com (2603:10b6:404:b9::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20 via Frontend Transport; Wed, 1 Jul 2020 06:22:53 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT053.mail.protection.outlook.com (10.13.182.197) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.10 via Frontend Transport; Wed, 1 Jul 2020 06:22:50 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiQ092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:49 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616MjsR030599; Wed, 1 Jul 2020 08:22:45 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616MjIA030598; Wed, 1 Jul 2020 08:22:45 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 4/9] usb: cdns3: Improvement: return IRQ_NONE explicitly. Date: Wed, 1 Jul 2020 08:19:59 +0200 Message-ID: <20200701062004.29908-5-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(346002)(376002)(136003)(39860400002)(396003)(36092001)(46966005)(86362001)(107886003)(478600001)(4744005)(54906003)(1076003)(6666004)(81166007)(83380400001)(5660300002)(2906002)(26005)(356005)(82310400002)(8936002)(186003)(47076004)(36906005)(70206006)(70586007)(316002)(110136005)(42186006)(7416002)(4326008)(2616005)(82740400003)(8676002)(426003)(336012)(36756003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b9b7b792-e911-4acf-a846-08d81d872e42 X-MS-TrafficTypeDiagnostic: CH2PR07MB6456: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:469; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: bZwf6sr6LqLcjR/JatjEYyQFf8qwx+kjeJjI7UKtbp7AnjocJFLSxygVhswxhLoOKyeLm+OhTRy6Jt01pWYSfWTItwObTkHbfpKN3WXeONTCqsskftd69jRAud55BsJdrHVxz7xTq/gzY+Ua4OsJFwmmYTmOC6Nk1cLDKUjONfahA71swiidCxsV2Vbswn4pei5h7QtD967Tqa4UD7FVtQx45SppIeZZI2d7R11b3eBQf+ziypP0PDQJDfMuXGXNvfz8cDHAwx7H3VB4fkGkesqxXtF2cMiMJeqr7oCc62FhRfklEwnBfkJZJ8En1VGUoVhNfRmja+lY/qCGAkAAsA10FDDV04xelPASVUYWKtcuTfFIVB9KLcBaYFUWuYCkJuhboYsyOiCHHF3jRN8pEnicz37hxuTXDDDBqML/eik= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:50.5326 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b9b7b792-e911-4acf-a846-08d81d872e42 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT053.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR07MB6456 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 phishscore=0 cotscore=-2147483648 mlxlogscore=676 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org IRQ_NONE can be returned indirect. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/drd.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c index 6d2da504ad49..05a9f7d54c46 100644 --- a/drivers/usb/cdns3/drd.c +++ b/drivers/usb/cdns3/drd.c @@ -279,12 +279,12 @@ static irqreturn_t cdns3_drd_irq(int irq, void *data) u32 reg; if (cdns->dr_mode != USB_DR_MODE_OTG) - return ret; + return IRQ_NONE; reg = readl(&cdns->otg_regs->ivect); if (!reg) - return ret; + return IRQ_NONE; if (reg & OTGIEN_ID_CHANGE_INT) { dev_dbg(cdns->dev, "OTG IRQ: new ID: %d\n", From patchwork Wed Jul 1 06:20:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635393 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 06388618 for ; Wed, 1 Jul 2020 06:25:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCADD2074D for ; Wed, 1 Jul 2020 06:25:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="SZuVH/5T"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="0T1mrLfI" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727024AbgGAGZP (ORCPT ); Wed, 1 Jul 2020 02:25:15 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:21100 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726287AbgGAGZP (ORCPT ); Wed, 1 Jul 2020 02:25:15 -0400 Received: from pps.filterd (m0042333.ppops.net [127.0.0.1]) by mx0b-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616FfFA012554; Tue, 30 Jun 2020 23:22:54 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=z9MJJMR3WCtRx/mkugId9tTgosXoT7u0dwHDi8yatK0=; b=SZuVH/5TVUzVeqD4HjTflunAre51qNpEHEe64n2HEhWjbo/2Puwr94NFYtoRYg5dZ/l4 PFegOdUgRrBoD90Dv+xDMtzzM/9XMgOd7n/NkWsgvCg/I9IVmTPsutsGb1hyVrF+Xu16 vbhFyr2nfF41uSmI0HRMr7tFoLUXKBl7S9p6kbPTqxNeHoimMDa2AkCU8o1iIlBKPNs9 0S4yw+RZf6/3YXCly2fHK0vJVoOFRnaA1x41Qb0B+5TZs5iL2pAFGP4YuH8lGJ1XOFsG d6JkD41YFoq5dkBQeX6bp3P9FddZPNTzk6oLtpExkqL7SKliqkgwgRkXEmRCTwF6hM4C yg== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2168.outbound.protection.outlook.com [104.47.57.168]) by mx0b-0014ca01.pphosted.com with ESMTP id 31x1pyq6s9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:54 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=RDbYfKfpDaN5DXiUNBTw9iUYtNkWwPoYyupLI1af7ETrnR5veaExolME3TloqETCt2XE+lAqSuT9E3n5dXerb9AGEDbyKbiag/OVtLEI99V/aJQl+5fLTkVl+qa83mYuuU/6f6SUvl1tggspYm3CJGJw9LmxArFwL5zTLjFYqkc32TmyuXXFvsEMyYRc6eyKyeMY3EQqCtXXsz9+/Ner3PrnLD6ifUoeu8dEwu7pRmw9TEjtBJHzVQaJK9ZEv9YzAgVkqgDIgpysT3gSZfUM3ETr/CS/7hYr1TXXwmQaD9BJR0ZDjhDkf8pjtnPI42LZUI1wbzTlytmXz3h7MMb7aA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z9MJJMR3WCtRx/mkugId9tTgosXoT7u0dwHDi8yatK0=; b=g6US9ro40w6dgoe/AfqZKLj9oCCaT0I+vv7aU59wT9leaSODbx23Rw8xdgoNaExxj9jAVVlSW48fig8Y7lZiXFbjJzC8egRG1ylXp3v1KWqBzhMEDuFPP4ORJfdwxr0N3R2RBDforYoMBdKUdE/3F5kCXa5DtR4zLcYN5CtSGJbeAQGRn1yT5eQZbui2KlP8RzlnrstU9eJgZqpSa65icRqJ0Lw2fbQFG5/Es7SDBKhZIaeDAVmgCx6DKAWB3mM9Cih5OaDVcEju8yQD+oNnLH0qbnP2tAm/qKmitZqWbtGYHk/kO4Gz7y1lr+FuMqyWnpaOebct8ZS0vV/dGpSktw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=z9MJJMR3WCtRx/mkugId9tTgosXoT7u0dwHDi8yatK0=; b=0T1mrLfI1uPKd4R+0rXGHl17tTHOvfUxN7V7PKgndDR20Rw0JMlUS8S7biqkLdAM068nTBcqOgNUJYPrcxWbOMBoqMloWmuIuTVCPK4DIR4uyhr+Bk1CQA4h27Nl5nyFaE1keRuiE48eJXABC4WGgY6MCUN7/Ugx4bvl0swittI= Received: from BN6PR03CA0071.namprd03.prod.outlook.com (2603:10b6:404:4c::33) by SN6PR07MB5632.namprd07.prod.outlook.com (2603:10b6:805:e9::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21; Wed, 1 Jul 2020 06:22:52 +0000 Received: from BN8NAM12FT019.eop-nam12.prod.protection.outlook.com (2603:10b6:404:4c:cafe::2a) by BN6PR03CA0071.outlook.office365.com (2603:10b6:404:4c::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23 via Frontend Transport; Wed, 1 Jul 2020 06:22:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT019.mail.protection.outlook.com (10.13.183.160) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.17 via Frontend Transport; Wed, 1 Jul 2020 06:22:50 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiR092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:49 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616MjS2030603; Wed, 1 Jul 2020 08:22:45 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616MjHR030602; Wed, 1 Jul 2020 08:22:45 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 5/9] usb: cdns3: Improvement: changed return type from int to bool Date: Wed, 1 Jul 2020 08:20:00 +0200 Message-ID: <20200701062004.29908-6-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(136003)(396003)(39860400002)(346002)(376002)(36092001)(46966005)(4326008)(6666004)(2906002)(83380400001)(36906005)(316002)(42186006)(110136005)(478600001)(47076004)(82310400002)(356005)(82740400003)(81166007)(54906003)(107886003)(5660300002)(86362001)(426003)(70586007)(7416002)(70206006)(8676002)(26005)(186003)(36756003)(8936002)(2616005)(336012)(1076003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f294e33a-7bd4-45c4-82af-08d81d872e83 X-MS-TrafficTypeDiagnostic: SN6PR07MB5632: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: NkuUNCnc+7Yq9MdoyEMI8Zn7jsOteRERHTYJXjdAG6quHCn9Um9vwdr/aZSsN6jOqViel40b6tzO7DIiUD9r5UU3uQAojzIWedscbvajRMZm1npdPzLvGhWSEnarLq7S4TLoJ0dB+hRxQjyZvel1lcqFiOW0r/sKFKocmDoukSDGKavWVSRzeeiT3Fih5RboPcg6q74Ug2pdqleoP2v4ITAFJW7dB9VMM0Fx5jcCYCHReq4MQUJlEM4/FyQREijXB3WAhyBlFxKm8wGdw3ae0WQlOlxNEXv1pn2U8hTETRtLBdbmPmanvpwvm0IJM+zfFFlxsPCGaP5k/txzTGLa6uVmmy0aylEfbpZdtDUUY92mP7OjpOS+1RQxVzxIaJ3Aiq6XY+aXxhakk+bZnLzwk0oeaYsyY+WTS/as0Q3adpA= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:50.9557 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f294e33a-7bd4-45c4-82af-08d81d872e83 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT019.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN6PR07MB5632 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 priorityscore=1501 mlxscore=0 phishscore=0 malwarescore=0 cotscore=-2147483648 bulkscore=0 adultscore=0 suspectscore=0 impostorscore=0 mlxlogscore=774 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Patch changes return type from int to bool for cdns3_is_host and cdns3_is_device functions. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/drd.c | 16 ++++++++-------- drivers/usb/cdns3/drd.h | 4 ++-- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c index 05a9f7d54c46..6fe092c828b3 100644 --- a/drivers/usb/cdns3/drd.c +++ b/drivers/usb/cdns3/drd.c @@ -83,25 +83,25 @@ int cdns3_get_vbus(struct cdns3 *cdns) return vbus; } -int cdns3_is_host(struct cdns3 *cdns) +bool cdns3_is_host(struct cdns3 *cdns) { if (cdns->dr_mode == USB_DR_MODE_HOST) - return 1; + return true; else if (!cdns3_get_id(cdns)) - return 1; + return true; - return 0; + return false; } -int cdns3_is_device(struct cdns3 *cdns) +bool cdns3_is_device(struct cdns3 *cdns) { if (cdns->dr_mode == USB_DR_MODE_PERIPHERAL) - return 1; + return true; else if (cdns->dr_mode == USB_DR_MODE_OTG) if (cdns3_get_id(cdns)) - return 1; + return true; - return 0; + return false; } /** diff --git a/drivers/usb/cdns3/drd.h b/drivers/usb/cdns3/drd.h index 04e01c4d2377..35b6d459ee58 100644 --- a/drivers/usb/cdns3/drd.h +++ b/drivers/usb/cdns3/drd.h @@ -153,8 +153,8 @@ struct cdns3_otg_common_regs { /* Only for CDNS3_CONTROLLER_V0 version */ #define OVERRIDE_IDPULLUP_V0 BIT(24) -int cdns3_is_host(struct cdns3 *cdns); -int cdns3_is_device(struct cdns3 *cdns); +bool cdns3_is_host(struct cdns3 *cdns); +bool cdns3_is_device(struct cdns3 *cdns); int cdns3_get_id(struct cdns3 *cdns); int cdns3_get_vbus(struct cdns3 *cdns); int cdns3_drd_init(struct cdns3 *cdns); From patchwork Wed Jul 1 06:20:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635379 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D6753618 for ; Wed, 1 Jul 2020 06:23:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B617E2078B for ; Wed, 1 Jul 2020 06:23:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="fVtOxF6E"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="b7zArpwR" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727855AbgGAGX0 (ORCPT ); Wed, 1 Jul 2020 02:23:26 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:47046 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727841AbgGAGXX (ORCPT ); Wed, 1 Jul 2020 02:23:23 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616HCf0014542; Tue, 30 Jun 2020 23:22:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=Yx/OstEb1e+mVzdVSn72cLU0gdYjamPLns9M36RHJTE=; b=fVtOxF6Echy9jgUGI2nLWVEScz1tqjELBnaYbrWncUERvMqOUOsC3NUJFQq9mkUbbtVY Julh9K4cWpHpo/EuPeeb+SSYi4tYHuGH9yj5d61ZkZAa0oFuat9hfKBFJZi5YvcxQaTz HenCDfGUsyJnUW8EI6lrVov0I8IBGgKj+i/c1Dlu2oqNGGftjY9iRjn/3m4DnSpurbol 8NVJvopiJiwTIqSz0ICQTdaHZP0T5K/KnpTfkfM8m/v68TkZc0cD245BuzY1Lah/S3bd iF4GyYnAgP0S9v3+FXqr8/94YJWQD7Wh1s2bIs9QufwmeBhw42L7RtYaCA43ieUi41Wm QA== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2101.outbound.protection.outlook.com [104.47.55.101]) by mx0a-0014ca01.pphosted.com with ESMTP id 31x2nxxa8f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Iz+ewcmSaKs9HWjNBeQ4fNFSFNThZjy2zzsR8GmZxAs+v3QMwhixS5PYNmTY9fCjs+kyrWcc6A0wCQrGAr4+ObhcHemmsPm/OfHCL4JjMSjtlgY9SGGqFb8vlCRRaOartmCBMrFEjNl5ht4cOjCNxC4sOUriWXDixv3UdCVqOryIY+4iZ034qEh23bTK+YBCQi1C6v0fLue/GIefymuiVTuDagxlP6ptzawN/EJ+vcckhPQzpie/eirgB2RVIuQHKjqUmboFZdvUilGcnxV1B7JBPqqB/4ApzPjLi5aV9FXTJji3EY3qz+Cvx9ZUsNsncPJhRFALixiBcrtvbpd8EA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yx/OstEb1e+mVzdVSn72cLU0gdYjamPLns9M36RHJTE=; b=FH/FxBoOx9X1/or5mmKWyKCAPz+C8tf1mHf+wPzMmDsWcMdoLdfKAZpDRbvp+ZlDlR+rVjsurSk0OazKIapQU47A7YSNk5oahiwsNneVJBtETzL3jmLEsVjQxodV+MWVXnnIUGQKT92qzEmwEVhEPYVDx1wFAnUszodneF5bNylrbyj1wxUaKRbRY7aD1Tw/xbG4NqfwSlCWZGduBhC2q5On1pXhRyelsSp1x8FXAXD8H7qVyNn2vWqrIgAdhnMvvK2rVBpA6wtOE7xETSjBGyrSA1Zu3OpV3fsk0Z5RZPTCDRuEMvX0K1Fg5gpL8z9d+j+7MSWAynfVICl80QREXw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Yx/OstEb1e+mVzdVSn72cLU0gdYjamPLns9M36RHJTE=; b=b7zArpwRMGMiSwJ5j448nyAJUyadkSbkHjFsHGBhA+Cgh9KGbTKojuVD2FG7EPjeDA8nYBhmN5JHRpCQAPNrlsLXX4xDs98jokKHoZOS4ZQDmUjV4q4MlZyduFwgvuWK9sxz8pCNjFqzr52DGfrTOcmXZ7dySeUvQzp/LBeMWn8= Received: from BN6PR10CA0003.namprd10.prod.outlook.com (2603:10b6:405:1::13) by BYAPR07MB5333.namprd07.prod.outlook.com (2603:10b6:a03:62::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.25; Wed, 1 Jul 2020 06:22:53 +0000 Received: from BN8NAM12FT038.eop-nam12.prod.protection.outlook.com (2603:10b6:405:1:cafe::9f) by BN6PR10CA0003.outlook.office365.com (2603:10b6:405:1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20 via Frontend Transport; Wed, 1 Jul 2020 06:22:52 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT038.mail.protection.outlook.com (10.13.183.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.17 via Frontend Transport; Wed, 1 Jul 2020 06:22:51 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiS092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:50 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616Mj20030607; Wed, 1 Jul 2020 08:22:45 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616MjSs030606; Wed, 1 Jul 2020 08:22:45 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 6/9] usb: cdns3: Added CDNS3_ID_PERIPHERAL and CDNS3_ID_HOST Date: Wed, 1 Jul 2020 08:20:01 +0200 Message-ID: <20200701062004.29908-7-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(396003)(376002)(136003)(346002)(39860400002)(36092001)(46966005)(47076004)(70586007)(70206006)(356005)(81166007)(336012)(426003)(36756003)(82310400002)(7416002)(110136005)(316002)(478600001)(83380400001)(6666004)(2616005)(54906003)(42186006)(26005)(82740400003)(8936002)(186003)(4326008)(107886003)(1076003)(2906002)(5660300002)(8676002)(36906005)(86362001);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b50eb41d-4840-4205-54e1-08d81d872ec2 X-MS-TrafficTypeDiagnostic: BYAPR07MB5333: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: z8vEJAHZ3xuvfyWVO/yKwm5NwsuovllDaeDc09TzSnYwfZsLx8GsSIZfkreIAgOfUvlEB1n42R/nxIpfO22LMU/GAVETy582fpO6wp/GaZNB6w2fCA+NbyfRaX+YUU5tlZEynFm8/cSJZCnelLA1cXcxwo+Ggb26K10/Ng2MqS7PoB5/mlLuX9NWuz8H/vodBVkBHVynbb1amSRIz82XZV0BSluvZWaQtJhENhcRlctBI3GpGTVExcqU1Z7BP6AmkXMZZKAz/NjmG6oMDSNW3GPuHHiw97mjK2WZ8rdYjUhKbC1tir//luSHP0XBBX/9yOPx8RcPdawEDhsZ2zXsPbTPOvkcYIOghLTVvAhvIRNlFrflXdFqXgU3/P7pLdAuKb586t4iIr82wvdyzQtnjTGPRpbKZMSAm0NzEyMQI/w= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:51.3624 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b50eb41d-4840-4205-54e1-08d81d872ec2 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT038.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB5333 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 phishscore=0 cotscore=-2147483648 mlxlogscore=572 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Patch adds 2 definitions that make it easier to understand the code. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/drd.c | 4 ++-- drivers/usb/cdns3/drd.h | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c index 6fe092c828b3..8e7673da905e 100644 --- a/drivers/usb/cdns3/drd.c +++ b/drivers/usb/cdns3/drd.c @@ -87,7 +87,7 @@ bool cdns3_is_host(struct cdns3 *cdns) { if (cdns->dr_mode == USB_DR_MODE_HOST) return true; - else if (!cdns3_get_id(cdns)) + else if (cdns3_get_id(cdns) == CDNS3_ID_HOST) return true; return false; @@ -98,7 +98,7 @@ bool cdns3_is_device(struct cdns3 *cdns) if (cdns->dr_mode == USB_DR_MODE_PERIPHERAL) return true; else if (cdns->dr_mode == USB_DR_MODE_OTG) - if (cdns3_get_id(cdns)) + if (cdns3_get_id(cdns) == CDNS3_ID_PERIPHERAL) return true; return false; diff --git a/drivers/usb/cdns3/drd.h b/drivers/usb/cdns3/drd.h index 35b6d459ee58..3889fead9df1 100644 --- a/drivers/usb/cdns3/drd.h +++ b/drivers/usb/cdns3/drd.h @@ -153,6 +153,9 @@ struct cdns3_otg_common_regs { /* Only for CDNS3_CONTROLLER_V0 version */ #define OVERRIDE_IDPULLUP_V0 BIT(24) +#define CDNS3_ID_PERIPHERAL 1 +#define CDNS3_ID_HOST 0 + bool cdns3_is_host(struct cdns3 *cdns); bool cdns3_is_device(struct cdns3 *cdns); int cdns3_get_id(struct cdns3 *cdns); From patchwork Wed Jul 1 06:20:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635383 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 80DB6618 for ; Wed, 1 Jul 2020 06:23:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 623302083E for ; Wed, 1 Jul 2020 06:23:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="PiTdnBm0"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="JQgIevwy" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727841AbgGAGXf (ORCPT ); Wed, 1 Jul 2020 02:23:35 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:57654 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727845AbgGAGXZ (ORCPT ); Wed, 1 Jul 2020 02:23:25 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616H8i8014514; Tue, 30 Jun 2020 23:22:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=glIcFcCBnE/kWZjNZISuj/oddo60+Gb0CBumRR6l66c=; b=PiTdnBm0r3cvDg1NPdITY1B0G1QBOOqS4753Yn2hBA3Osbmcu1Y7I9LU8vcE1HhKivA/ Os88vVL2PAe8yTcH/jt1QkjQVqrKIzexS8PTZp2apQlfSxGGmkGNLslF+VgxHaXfEvBW 8MmVQ24pqT7aZmRT97zYexiaBSXsjCDbOxpVNJpJgW/JVjE6I3RdDEdWBYgl1axy6uYW pKMq2oz3439j0ZD/9+1BI7EUOOUCPoMuFTE2/WYYF1BYFDmdjPT3w3kAPCe2rb1kgezz ZzbjKNgZXqy1HkqBUNX5QM66rvskdGjPw8xSVJ8EEFtYZWo7OG/Mb1fupGY2iCnBaDH3 1Q== Received: from nam04-co1-obe.outbound.protection.outlook.com (mail-co1nam04lp2059.outbound.protection.outlook.com [104.47.45.59]) by mx0a-0014ca01.pphosted.com with ESMTP id 31x2nxxa8j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:56 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gaiENie34PiCtDcAbRMC1+wN0BOc4/xz3UiXH/PCz+36UDYuimj3n0PLhniGDwl7t4NFsP7a1xEawShwHGlVM2V4ql2VlzKXPUaE3jaUz9Z1g1XoyY6//NLoh+mjDQLosx8rAOeDUbd46j4ajQEq5yQiatcGb9Jh00GaLU5Fi3S3YofE24/o1yv+NKvpFrwB/PjuqKSqkUpjRVLFZYXeZQlTKyuos67FoubSk6dTFSIErF6D7FiMVeicw4QjuU0tkPXQMPT6TFBmMxSZKkqRFCIna/3pAjAbgARzbVmcvwax3r9xmcyOJ3+KKrYTcHUg8ChdFUyu7gB2FLY3jwHsmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=glIcFcCBnE/kWZjNZISuj/oddo60+Gb0CBumRR6l66c=; b=MV91qjdQX6K2+LBKL5pJNdn1gyuHVuB+PRP7pxQ3Vlo92Ndmj/SZxgm7rnWuutTOSSXPzaSv+P79+GqOhGU6S0gMaxKX7cWqj8ZWaP8lDl06fcenprr88A6OH3mEXK+pHFRagXVIv36td+T1AjKfNI3kvwMuDAs90tsrda3WivcMfEcSiTPw25Kb8jIJCGsQQegnz8xz/t3SlbWYK4zaTi3ei68vYDEQ06W/sjySQsyPK6m4JoM3UH6Xcv/tqP81Npar7/CqC7C170DyITRuPoLHt0lHsYF7vqie62QqvqTgjR/aJJI26bzqg+JsWSrOpBA/z9zLBb3qMMxS5xhllA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=glIcFcCBnE/kWZjNZISuj/oddo60+Gb0CBumRR6l66c=; b=JQgIevwy0OAHa1ai8oq618sRIdnR5dn9wmu3qtB+J68egRcKl/BAtJGpC4xBFZcC8fF/UhA/5aahLHK+KIa3JGwRwyAfljFibLnvLuP06zNm6keDSqlFRkj6exvpoJtl8UPqXdzW4MU77d7XMubvD+b760X+CPF1v2YHQeBwwiY= Received: from BN4PR12CA0023.namprd12.prod.outlook.com (2603:10b6:403:2::33) by BN8PR07MB6338.namprd07.prod.outlook.com (2603:10b6:408:b8::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20; Wed, 1 Jul 2020 06:22:54 +0000 Received: from BN8NAM12FT046.eop-nam12.prod.protection.outlook.com (2603:10b6:403:2:cafe::97) by BN4PR12CA0023.outlook.office365.com (2603:10b6:403:2::33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.21 via Frontend Transport; Wed, 1 Jul 2020 06:22:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT046.mail.protection.outlook.com (10.13.183.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.16 via Frontend Transport; Wed, 1 Jul 2020 06:22:51 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiT092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:50 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616Mjep030611; Wed, 1 Jul 2020 08:22:45 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616MjHm030610; Wed, 1 Jul 2020 08:22:45 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 7/9] usb: cdns3: Improvement: removed 'goto not_otg' Date: Wed, 1 Jul 2020 08:20:02 +0200 Message-ID: <20200701062004.29908-8-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(346002)(376002)(396003)(39860400002)(136003)(36092001)(46966005)(81166007)(82310400002)(83380400001)(82740400003)(47076004)(8676002)(8936002)(86362001)(7416002)(54906003)(478600001)(316002)(110136005)(36906005)(42186006)(356005)(107886003)(2906002)(1076003)(26005)(36756003)(4326008)(186003)(426003)(6666004)(2616005)(336012)(70206006)(70586007)(5660300002);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 88dae4e6-c7b7-4cdc-3601-08d81d872f11 X-MS-TrafficTypeDiagnostic: BN8PR07MB6338: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:820; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ILGtKNxW8tcV9Jwl6eUZvDZ273Vk2KKwx3TOJ4xwN9T2DaeUfFQOfk42wb97PLP86oGDnFR8onT1CWWJWeJBtmQmkqdcl6fstJLE4m/Vf2XTzo+rkxmLfla8oO0LxqKrasBMykmnOls7+AUf+oKNXUkQQMcIOAzXnvVUGhjXl5En/J1m6tOr9k9YHKCioXz+/0r/ejKZSirh/1kqEPeW8DoEIAhH1H3IbztwxtGOzd+NU2KeUfR/SQQHvDpAq7HgTxWYluWA6gXmRvSoapqmKyoLErOOn8K7N8DRc66pX5MGP4WmpnLUJsv/YuwgYOyOhHmrjD79YsPVJvMUwsO2qnSsHP/05K0RaNTAqSgHqeViCTSxIWCfzv25eOVhcJXETkeNu4+wimTWH0xw4sm9ygrNZaXDraCNEV3VCrdxB6U= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:51.8833 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 88dae4e6-c7b7-4cdc-3601-08d81d872f11 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT046.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR07MB6338 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 phishscore=0 cotscore=-2147483648 mlxlogscore=776 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Patch removes 'goto not_otg' instruction from cdnsp_hw_role_state_machine function. Signed-off-by: Pawel Laszczak --- drivers/usb/cdns3/core.c | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index c3dac945f63d..591186987245 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -191,11 +191,17 @@ static int cdns3_core_init_role(struct cdns3 *cdns) */ static enum usb_role cdns3_hw_role_state_machine(struct cdns3 *cdns) { - enum usb_role role; + enum usb_role role = USB_ROLE_NONE; int id, vbus; - if (cdns->dr_mode != USB_DR_MODE_OTG) - goto not_otg; + if (cdns->dr_mode != USB_DR_MODE_OTG) { + if (cdns3_is_host(cdns)) + role = USB_ROLE_HOST; + if (cdns3_is_device(cdns)) + role = USB_ROLE_DEVICE; + + return role; + } id = cdns3_get_id(cdns); vbus = cdns3_get_vbus(cdns); @@ -232,14 +238,6 @@ static enum usb_role cdns3_hw_role_state_machine(struct cdns3 *cdns) dev_dbg(cdns->dev, "role %d -> %d\n", cdns->role, role); return role; - -not_otg: - if (cdns3_is_host(cdns)) - role = USB_ROLE_HOST; - if (cdns3_is_device(cdns)) - role = USB_ROLE_DEVICE; - - return role; } static int cdns3_idle_role_start(struct cdns3 *cdns) From patchwork Wed Jul 1 06:20:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635375 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 46335913 for ; Wed, 1 Jul 2020 06:23:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2617320775 for ; Wed, 1 Jul 2020 06:23:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="S1EhlMI9"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="UPjH4Zgi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727119AbgGAGXO (ORCPT ); Wed, 1 Jul 2020 02:23:14 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:1278 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727071AbgGAGXN (ORCPT ); Wed, 1 Jul 2020 02:23:13 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616HC8q014545; Tue, 30 Jun 2020 23:22:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=kpI9AXyfpjA4dbJZklM0CwGjby9vJInyNJP4bZPsXDQ=; b=S1EhlMI9mgNf4ZMR4MYzuLSt4SUlFZohJtZElzvrPXwUKlk7m5GpAMxTtvhVbvmJxSyH 2fteLy0biTaSQClkXDRIeiLFDiyUk5WctGxLtKaUCJfXwavdZkTuLlWYyusv2nHc3fyp 33CXG7BX7USTUbnZYZhonGXQaMpRMwL+kjXZSSp3poVglOpMG2f46hy/+DxByjsD6z/f UUktcb5EEuOKCXcU4KjnbEY492JzmEY7dQrE/0sIOMFIDo1ZbCBtoquE6dHQnnedZjyN V4ShjUX5IWMtysJUizYQx5JvemIqRV7IUtNh+9iXdrm4LpM25T677CWOxi0n3KGXkpLU RA== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2175.outbound.protection.outlook.com [104.47.56.175]) by mx0a-0014ca01.pphosted.com with ESMTP id 31x2nxxa8k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=IJFauT391Vtc3VHdGiYzarf0675KbS/8hALnCdkZI0j0iUIVBpRp0JJGz7NeshX44xXhw7hLLRwb2W8D2fRfm5pZspjChYzHkZUHprv1hJd/9cHvttBSsbUhjko/SBgcfrsEAHmw5ezlsJ6KLnFlkKMCR+CxGVB4mxuZQZXF3hc5FOsdbGam3BRM7QIVEdwlU2lxSXWENdiWLxBylnoO9F0/eNyTeTDJS6M0Xm3ZaUKmyZAg7jBSyPwQ0Ue9ZX858QS2bZr+12qbjDp015lJSdrO9H39u8optlCtWdTc9Ulxa8vlgDvwZMuOKhdN9tlGkYVMeZRq08hZfR5kSFmXzA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kpI9AXyfpjA4dbJZklM0CwGjby9vJInyNJP4bZPsXDQ=; b=U/ais9Gg40BsRcVGo1dE0GX0M1VUUL+dYC985T4lgaxwhWrheLkAD5AO44BmK1qVXM6VNMEhuyjhPpR4TSaTeyAEazzETI8ZSULVgjOLEIHlXLSqZbQmaq3X/OIKBbYlYoJSLGZ6iP2Jcxp91SGp+3XeMl+Cvu0TJYkvp78YC6Ii3YlqEA4050snMfeU8/EdN0D/PdTX3Kl6z5PY4qMhJWPzZx+68z+2yItAuqoqKE8nK84HVzmw+YsWJ96iSFUEZzJG5adr/YpslPbxu8hFivHtRkbxnDkFumMB3236lNBOMMaK+95Xp9LPkDvxkTkVxnx/OmC+kQmjGwz59mvEVg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=kpI9AXyfpjA4dbJZklM0CwGjby9vJInyNJP4bZPsXDQ=; b=UPjH4ZgiDY9uWAp5wwebAFNGMY/T/kirqeXwLV2bX5YH36Oms4Z4QzIVtb5W2/rA/pwcm4S1h+kQrQu7ZMaiNDwbAfXXibsiNuoeYbwbv3teZVpPJ115VmL7N2xXgfoMXXj1z8BPv62mNnt9plIRGhMxspgFH1/2otBGEYvqHxo= Received: from BN6PR2001CA0035.namprd20.prod.outlook.com (2603:10b6:405:16::21) by BYAPR07MB6312.namprd07.prod.outlook.com (2603:10b6:a03:118::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.24; Wed, 1 Jul 2020 06:22:54 +0000 Received: from BN8NAM12FT025.eop-nam12.prod.protection.outlook.com (2603:10b6:405:16:cafe::ab) by BN6PR2001CA0035.outlook.office365.com (2603:10b6:405:16::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.20 via Frontend Transport; Wed, 1 Jul 2020 06:22:54 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT025.mail.protection.outlook.com (10.13.183.228) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.17 via Frontend Transport; Wed, 1 Jul 2020 06:22:52 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiU092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:51 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616Mjvj030615; Wed, 1 Jul 2020 08:22:45 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616MjXq030614; Wed, 1 Jul 2020 08:22:45 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 8/9] usb: cdns3: Improvement: removed overwriting some error code Date: Wed, 1 Jul 2020 08:20:03 +0200 Message-ID: <20200701062004.29908-9-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(376002)(136003)(39860400002)(396003)(346002)(36092001)(46966005)(86362001)(2616005)(5660300002)(36756003)(42186006)(1076003)(426003)(110136005)(4326008)(6666004)(336012)(36906005)(316002)(54906003)(8936002)(81166007)(83380400001)(2906002)(47076004)(356005)(82740400003)(82310400002)(26005)(7416002)(186003)(478600001)(8676002)(107886003)(70206006)(70586007);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f1b33b78-872e-416b-5add-08d81d872f66 X-MS-TrafficTypeDiagnostic: BYAPR07MB6312: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:421; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CoscXcAXH16AxEHZBbOOeskD5P5bFV/Jq4X+8qP382SUFb0E7mtfPCXjkvXdlXSPPNMx7rxMAKcYZWm4xHLsRv4zuBysleYPGge+FNa/bTpU8HkirT86p8EPEcSVzwOQ/X8yYcE24UTMWBPRJyeCkI+4so1scotlbvVI7P/5Zb432cW9z4X6wf4E/hNOkuagtEIMJaSJQYa9mGKtyM8nVnQvn0Jloko/SvjueJNp7ke5aeOjJj7Vj6WuMi3f8lDDRV+9FrdEHrxpIikm0e58dxXiBwu37QPP+owoVuDZtmh+JdJO9U9PaVK3RiqFARUrcqY2SrqSL9Zd5IkXhZrfS2cKZzC8sKjfbHaJ+PAwSh7ZCi7NsQ3MNuxV4d4bigrWBaXNc8rXL9ZiVEUU2/CHHSklJRs31psIIbXX8zhE01w= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:52.4443 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f1b33b78-872e-416b-5add-08d81d872f66 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT025.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB6312 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 phishscore=0 cotscore=-2147483648 mlxlogscore=951 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Some error code can be preserved, so we can remove overwriting error code returned by some functions. Signed-off-by: Pawel Laszczak Reviewed-by: Peter Chen --- drivers/usb/cdns3/core.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/usb/cdns3/core.c b/drivers/usb/cdns3/core.c index 591186987245..01155ab73930 100644 --- a/drivers/usb/cdns3/core.c +++ b/drivers/usb/cdns3/core.c @@ -347,7 +347,6 @@ static int cdns3_role_set(struct usb_role_switch *sw, enum usb_role role) case USB_ROLE_HOST: break; default: - ret = -EPERM; goto pm_put; } } @@ -358,17 +357,14 @@ static int cdns3_role_set(struct usb_role_switch *sw, enum usb_role role) case USB_ROLE_DEVICE: break; default: - ret = -EPERM; goto pm_put; } } cdns3_role_stop(cdns); ret = cdns3_role_start(cdns, role); - if (ret) { + if (ret) dev_err(cdns->dev, "set role %d has failed\n", role); - ret = -EPERM; - } pm_put: pm_runtime_put_sync(cdns->dev); @@ -393,7 +389,7 @@ static int cdns3_probe(struct platform_device *pdev) ret = dma_set_mask_and_coherent(dev, DMA_BIT_MASK(32)); if (ret) { dev_err(dev, "error setting dma mask: %d\n", ret); - return -ENODEV; + return ret; } cdns = devm_kzalloc(dev, sizeof(*cdns), GFP_KERNEL); From patchwork Wed Jul 1 06:20:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11635385 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6664E618 for ; Wed, 1 Jul 2020 06:23:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3CF8020663 for ; Wed, 1 Jul 2020 06:23:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="WenFUo3o"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="Hp7FCv7C" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727892AbgGAGXm (ORCPT ); Wed, 1 Jul 2020 02:23:42 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:55010 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727839AbgGAGXX (ORCPT ); Wed, 1 Jul 2020 02:23:23 -0400 Received: from pps.filterd (m0042385.ppops.net [127.0.0.1]) by mx0a-0014ca01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0616H9GK014532; Tue, 30 Jun 2020 23:22:57 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=proofpoint; bh=wgBXd/eRewPjVKWni72sYgBXfTGxIrpwbPBz3CJqa+U=; b=WenFUo3oyv2Fesg+yhP6obxDluTQ0GVpb4ESf1OxMbesaKyHcGydbbfnERxI7AgFQBPJ uhcYkqNAknftQwHZ93Z1/Tz9J/P0VG0S0eaSGgL+9liiBCOHJ0JcMiAY56s7bYi1HaFd S16o2LhDctHoUu0r4Y0fUlnwEZsb92E4sCxxz/HgrH2X0ZOfm2gOyJbrJDfAdv7/IubN BQCZsGLWX8JCl8oEvYP2U05eq93LYWw2uAUuD2tJDE7Y2h2IUuIVyZl7aQLqYeYgRjRn Hwq54coCwH/YysdRSbFbuosp174yscwe5hhsF1LqvJYZeI/2gJPht4HsrXmt8EzgyzyV QA== Received: from nam11-dm6-obe.outbound.protection.outlook.com (mail-dm6nam11lp2177.outbound.protection.outlook.com [104.47.57.177]) by mx0a-0014ca01.pphosted.com with ESMTP id 31x2nxxa8n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 30 Jun 2020 23:22:57 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I1WPxpPHajjPKaUi48zlWyVwDlO+8G6g1qql35DOraHfRJXq3SNBFmxy842C/r0awuRvKANVzCBu1t6xSUVOzN3K0bEWUjf7+1isRDX87MHZYwclOFsus22hfcyB0O5uzXcu/9rM04TwNtGVkahMFbBCu32+DOtSOM57ydqVzkn6WJExiIJXOXoO4vBMEG/Z7l/W59fbvrTLoFTTxiCTlWiQHbM1YxCzpEmeu9Fa1X3MFvaLGJt9K+UG5qvHe7zFsl9GPCRkLe3zIPkMjGxuthUBFhb5HhHyQibG9db4r48uRj1jDggluGZFFeMKL50fKoC5zWKYdxtyqWXzg/KNmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wgBXd/eRewPjVKWni72sYgBXfTGxIrpwbPBz3CJqa+U=; b=jiau3ID7odRphT2OuXtBBVZky8us1xYhWQBT4olmqFxhwJCuroc3mLHJeLn5zyJB+4SHQEs7KCSOeggxaZUIWzn/K4RQ5vOqG7bP7PZXGrsFwPoXlgWftTd/e7r/+xWbdesUORF+U9VyB5EGB24EMhTU40pWmmPXMi0OXdmM17JCNahXR8igQWsSC/dKqsmi8ybFxTBY+DMeMRGokqke1VOTYlJV0DdkCrGWLRSjkeSlinhFfG9Gq0YvwI4+6ze9Al5ZDXVS+HjYBEZB+jFj/bPNoDovzNVfOHhYZHTtfOzMH258/arh+ca5EF2WAsW70Nb2X8c5lGomRDEzyeYI1g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 64.207.220.244) smtp.rcpttodomain=vger.kernel.org smtp.mailfrom=cadence.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=cadence.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cadence.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wgBXd/eRewPjVKWni72sYgBXfTGxIrpwbPBz3CJqa+U=; b=Hp7FCv7C85t+B7xylKBatsWoJmAL4Hy8ap1KyOsaC8mWSBbisadX8Zj9C0WfBEe/d0pKHi8AiIwVTiiOV186XSswKj0xH3fRaxqDFMTFoE5+Tq14+rde/CsrQ8F5aou8eq/QWjVTcmCxnJ2cgu6tS1laXJMvLK7H+tFxaf8QAKw= Received: from BN6PR06CA0005.namprd06.prod.outlook.com (2603:10b6:404:10b::15) by SJ0PR07MB7613.namprd07.prod.outlook.com (2603:10b6:a03:289::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.26; Wed, 1 Jul 2020 06:22:55 +0000 Received: from BN8NAM12FT014.eop-nam12.prod.protection.outlook.com (2603:10b6:404:10b:cafe::82) by BN6PR06CA0005.outlook.office365.com (2603:10b6:404:10b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3131.23 via Frontend Transport; Wed, 1 Jul 2020 06:22:55 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 64.207.220.244) smtp.mailfrom=cadence.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=pass action=none header.from=cadence.com; Received-SPF: Pass (protection.outlook.com: domain of cadence.com designates 64.207.220.244 as permitted sender) receiver=protection.outlook.com; client-ip=64.207.220.244; helo=wcmailrelayl01.cadence.com; Received: from wcmailrelayl01.cadence.com (64.207.220.244) by BN8NAM12FT014.mail.protection.outlook.com (10.13.183.44) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3153.17 via Frontend Transport; Wed, 1 Jul 2020 06:22:52 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by wcmailrelayl01.cadence.com (8.14.7/8.14.4) with ESMTP id 0616MjiV092304 (version=TLSv1/SSLv3 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=OK); Tue, 30 Jun 2020 23:22:51 -0700 X-CrossPremisesHeadersFilteredBySendConnector: maileu3.global.cadence.com Received: from maileu3.global.cadence.com (10.160.88.99) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (10.160.88.83) by maileu3.global.cadence.com (10.160.88.99) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 1 Jul 2020 08:22:45 +0200 Received: from vleu-orange.cadence.com (localhost.localdomain [127.0.0.1]) by vleu-orange.cadence.com (8.14.4/8.14.4) with ESMTP id 0616Mjks030619; Wed, 1 Jul 2020 08:22:45 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 0616Mjj1030618; Wed, 1 Jul 2020 08:22:45 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH 9/9] usb: cdns3: Impovement: simplify *switch_gadet and *switch_host Date: Wed, 1 Jul 2020 08:20:04 +0200 Message-ID: <20200701062004.29908-10-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200701062004.29908-1-pawell@cadence.com> References: <20200701062004.29908-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:64.207.220.244;CTRY:CN;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:wcmailrelayl01.cadence.com;PTR:ErrorRetry;CAT:NONE;SFTY:;SFS:(4636009)(396003)(39860400002)(376002)(136003)(346002)(36092001)(46966005)(81166007)(7416002)(2906002)(426003)(83380400001)(110136005)(36756003)(336012)(70206006)(86362001)(356005)(6666004)(54906003)(70586007)(36906005)(82310400002)(2616005)(5660300002)(107886003)(478600001)(47076004)(8676002)(26005)(316002)(42186006)(8936002)(4326008)(1076003)(82740400003)(186003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fab5526c-24f6-4ad9-d893-08d81d872fb9 X-MS-TrafficTypeDiagnostic: SJ0PR07MB7613: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:949; X-Forefront-PRVS: 04519BA941 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: dPdVpPyarF9aJlYolyf4rl5PhsGAKcs0HO6J9Xcmct6U7Sj9GaLPhtIGVR+qL3RIGk/n+chcRin7+bUTE6c5Dc9MGPN3o2A2ShKcjMY8XDjVjhf6LkfvM/P8A42erVu+ojGc6ham/8wG3dZvEImHe0M74c/qSSGMa6sf37x/LZN4L7uUAmx7lbUJzq4OJ6g3ChyhQ3bgk7WsyJvjN5q/v6LgyWUGL0UJYiwQghRYkK09pl1z7W40a0NY171mhIKio6ppD6+P+adjteaE94/h/Nmn6DazNHBlg/4xV0RyJm75emFe+6fL64fmMILAFQS598cj8bxgeJYbDVyiuaSeUFG5jPm6TF7+J2Vplegr2i/0HpDWEkyMeUlWiLPLI9EaKeS2BrbKJf0OrwGmusSlRZC3Yc5QF3H0AaB7f/vqtXE= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Jul 2020 06:22:52.9885 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fab5526c-24f6-4ad9-d893-08d81d872fb9 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[64.207.220.244];Helo=[wcmailrelayl01.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT014.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR07MB7613 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-01_03:2020-07-01,2020-07-01 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 clxscore=1015 impostorscore=0 priorityscore=1501 malwarescore=0 phishscore=0 cotscore=-2147483648 mlxlogscore=896 bulkscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2004280000 definitions=main-2007010045 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Patch split function cdns3_drd_switch_gadget and cdns3_drd_switch_host into: - cdns3_drd_host_on - cdns3_drd_host_off - cdns3_drd_gadget_on - cdns3_drd_gadgett_off These functions don't have any shared code so it's better to have smaller, faster and easier functions. Signed-off-by: Pawel Laszczak Reviewed-by: Peter Chen --- drivers/usb/cdns3/drd.c | 124 ++++++++++++++++++++----------------- drivers/usb/cdns3/drd.h | 6 +- drivers/usb/cdns3/gadget.c | 4 +- drivers/usb/cdns3/host.c | 4 +- 4 files changed, 76 insertions(+), 62 deletions(-) diff --git a/drivers/usb/cdns3/drd.c b/drivers/usb/cdns3/drd.c index 8e7673da905e..6234bcd6158a 100644 --- a/drivers/usb/cdns3/drd.c +++ b/drivers/usb/cdns3/drd.c @@ -124,85 +124,97 @@ static void cdns3_otg_enable_irq(struct cdns3 *cdns) } /** - * cdns3_drd_switch_host - start/stop host - * @cdns: Pointer to controller context structure - * @on: 1 for start, 0 for stop + * cdns3_drd_host_on - start host. + * @cdns: Pointer to controller context structure. * - * Returns 0 on success otherwise negative errno + * Returns 0 on success otherwise negative errno. */ -int cdns3_drd_switch_host(struct cdns3 *cdns, int on) +int cdns3_drd_host_on(struct cdns3 *cdns) { - int ret, val; + u32 val; + int ret; - /* switch OTG core */ - if (on) { - writel(OTGCMD_HOST_BUS_REQ | OTGCMD_OTG_DIS, - &cdns->otg_regs->cmd); - - dev_dbg(cdns->dev, "Waiting till Host mode is turned on\n"); - ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val, - val & OTGSTS_XHCI_READY, - 1, 100000); - if (ret) { - dev_err(cdns->dev, "timeout waiting for xhci_ready\n"); - return ret; - } - } else { - writel(OTGCMD_HOST_BUS_DROP | OTGCMD_DEV_BUS_DROP | - OTGCMD_DEV_POWER_OFF | OTGCMD_HOST_POWER_OFF, - &cdns->otg_regs->cmd); - /* Waiting till H_IDLE state.*/ - readl_poll_timeout_atomic(&cdns->otg_regs->state, val, - !(val & OTGSTATE_HOST_STATE_MASK), - 1, 2000000); - } + /* Enable host mode. */ + writel(OTGCMD_HOST_BUS_REQ | OTGCMD_OTG_DIS, + &cdns->otg_regs->cmd); - return 0; + dev_dbg(cdns->dev, "Waiting till Host mode is turned on\n"); + ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val, + val & OTGSTS_XHCI_READY, 1, 100000); + + if (ret) + dev_err(cdns->dev, "timeout waiting for xhci_ready\n"); + + return ret; } /** - * cdns3_drd_switch_gadget - start/stop gadget - * @cdns: Pointer to controller context structure - * @on: 1 for start, 0 for stop + * cdns3_drd_host_off - stop host. + * @cdns: Pointer to controller context structure. + */ +void cdns3_drd_host_off(struct cdns3 *cdns) +{ + u32 val; + + writel(OTGCMD_HOST_BUS_DROP | OTGCMD_DEV_BUS_DROP | + OTGCMD_DEV_POWER_OFF | OTGCMD_HOST_POWER_OFF, + &cdns->otg_regs->cmd); + + /* Waiting till H_IDLE state.*/ + readl_poll_timeout_atomic(&cdns->otg_regs->state, val, + !(val & OTGSTATE_HOST_STATE_MASK), + 1, 2000000); +} + +/** + * cdns3_drd_gadget_on - start gadget. + * @cdns: Pointer to controller context structure. * * Returns 0 on success otherwise negative errno */ -int cdns3_drd_switch_gadget(struct cdns3 *cdns, int on) +int cdns3_drd_gadget_on(struct cdns3 *cdns) { int ret, val; u32 reg = OTGCMD_OTG_DIS; /* switch OTG core */ - if (on) { - writel(OTGCMD_DEV_BUS_REQ | reg, &cdns->otg_regs->cmd); + writel(OTGCMD_DEV_BUS_REQ | reg, &cdns->otg_regs->cmd); - dev_dbg(cdns->dev, "Waiting till Device mode is turned on\n"); + dev_dbg(cdns->dev, "Waiting till Device mode is turned on\n"); - ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val, - val & OTGSTS_DEV_READY, - 1, 100000); - if (ret) { - dev_err(cdns->dev, "timeout waiting for dev_ready\n"); - return ret; - } - } else { - /* - * driver should wait at least 10us after disabling Device - * before turning-off Device (DEV_BUS_DROP) - */ - usleep_range(20, 30); - writel(OTGCMD_HOST_BUS_DROP | OTGCMD_DEV_BUS_DROP | - OTGCMD_DEV_POWER_OFF | OTGCMD_HOST_POWER_OFF, - &cdns->otg_regs->cmd); - /* Waiting till DEV_IDLE state.*/ - readl_poll_timeout_atomic(&cdns->otg_regs->state, val, - !(val & OTGSTATE_DEV_STATE_MASK), - 1, 2000000); + ret = readl_poll_timeout_atomic(&cdns->otg_regs->sts, val, + val & OTGSTS_DEV_READY, + 1, 100000); + if (ret) { + dev_err(cdns->dev, "timeout waiting for dev_ready\n"); + return ret; } return 0; } +/** + * cdns3_drd_gadget_off - stop gadget. + * @cdns: Pointer to controller context structure. + */ +void cdns3_drd_gadget_off(struct cdns3 *cdns) +{ + u32 val; + + /* + * Driver should wait at least 10us after disabling Device + * before turning-off Device (DEV_BUS_DROP). + */ + usleep_range(20, 30); + writel(OTGCMD_HOST_BUS_DROP | OTGCMD_DEV_BUS_DROP | + OTGCMD_DEV_POWER_OFF | OTGCMD_HOST_POWER_OFF, + &cdns->otg_regs->cmd); + /* Waiting till DEV_IDLE state.*/ + readl_poll_timeout_atomic(&cdns->otg_regs->state, val, + !(val & OTGSTATE_DEV_STATE_MASK), + 1, 2000000); +} + /** * cdns3_init_otg_mode - initialize drd controller * @cdns: Pointer to controller context structure diff --git a/drivers/usb/cdns3/drd.h b/drivers/usb/cdns3/drd.h index 3889fead9df1..7e7cf7fa2dd3 100644 --- a/drivers/usb/cdns3/drd.h +++ b/drivers/usb/cdns3/drd.h @@ -163,8 +163,10 @@ int cdns3_get_vbus(struct cdns3 *cdns); int cdns3_drd_init(struct cdns3 *cdns); int cdns3_drd_exit(struct cdns3 *cdns); int cdns3_drd_update_mode(struct cdns3 *cdns); -int cdns3_drd_switch_gadget(struct cdns3 *cdns, int on); -int cdns3_drd_switch_host(struct cdns3 *cdns, int on); +int cdns3_drd_gadget_on(struct cdns3 *cdns); +void cdns3_drd_gadget_off(struct cdns3 *cdns); +int cdns3_drd_host_on(struct cdns3 *cdns); +void cdns3_drd_host_off(struct cdns3 *cdns); int cdns3_set_mode(struct cdns3 *cdns, enum usb_dr_mode mode); #endif /* __LINUX_CDNS3_DRD */ diff --git a/drivers/usb/cdns3/gadget.c b/drivers/usb/cdns3/gadget.c index c303ab7c62d1..6ea6839a2a8c 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -3014,7 +3014,7 @@ void cdns3_gadget_exit(struct cdns3 *cdns) kfree(priv_dev->zlp_buf); kfree(priv_dev); cdns->gadget_dev = NULL; - cdns3_drd_switch_gadget(cdns, 0); + cdns3_drd_gadget_off(cdns); } static int cdns3_gadget_start(struct cdns3 *cdns) @@ -3145,7 +3145,7 @@ static int __cdns3_gadget_init(struct cdns3 *cdns) return ret; } - cdns3_drd_switch_gadget(cdns, 1); + cdns3_drd_gadget_on(cdns); pm_runtime_get_sync(cdns->dev); ret = cdns3_gadget_start(cdns); diff --git a/drivers/usb/cdns3/host.c b/drivers/usb/cdns3/host.c index ad788bf3fe4f..36c63d9ecd37 100644 --- a/drivers/usb/cdns3/host.c +++ b/drivers/usb/cdns3/host.c @@ -19,7 +19,7 @@ static int __cdns3_host_init(struct cdns3 *cdns) struct platform_device *xhci; int ret; - cdns3_drd_switch_host(cdns, 1); + cdns3_drd_host_on(cdns); xhci = platform_device_alloc("xhci-hcd", PLATFORM_DEVID_AUTO); if (!xhci) { @@ -53,7 +53,7 @@ static void cdns3_host_exit(struct cdns3 *cdns) { platform_device_unregister(cdns->host_dev); cdns->host_dev = NULL; - cdns3_drd_switch_host(cdns, 0); + cdns3_drd_host_off(cdns); } int cdns3_host_init(struct cdns3 *cdns)