From patchwork Mon Jul 13 10:05:46 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659275 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 AEC17618 for ; Mon, 13 Jul 2020 10:06:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 9079F2083B for ; Mon, 13 Jul 2020 10:06:57 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="e5LQa87k"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="ksQdYWq2" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729657AbgGMKGe (ORCPT ); Mon, 13 Jul 2020 06:06:34 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:33664 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727834AbgGMKGd (ORCPT ); Mon, 13 Jul 2020 06:06:33 -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 06DA35kU026888; Mon, 13 Jul 2020 03:06:12 -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=pa314vjLTrlCI4ZsW8ad7qvIzY3kOvCySH9VwpWt/dI=; b=e5LQa87kngn9ojAhvngov4ppekTddqhVd6G6cugezwbQTbRUID3bsr4sz4SFfNEpEbb5 8PCbl5hAfbwIZiCzgF6/qT+26pfgfWJutYfXJSwf+Cj1xmqyQWudCQU0fj+uTGcmuwbx vDCf5k9Hym9BMPonzClouBYGmx6esORIA6ObMgY4kNmq1wvFxIBlhrlr96GjUr7rzBnP uMpYEgm3rX5z+MiM48DTVcWO2hH5aW8dcSvZY2oO7bbanR2auBxOOLl6CFE6vF2W+Msq 49JYcQEHVbSIQHRJdAG2wKgZj8feB3WYNTi12rrs6AutUhVJNxXoj+Ctz6WqSbAvcCp9 Vg== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2170.outbound.protection.outlook.com [104.47.55.170]) by mx0a-0014ca01.pphosted.com with ESMTP id 3279yud6c8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kdsLu/HUO2xT2rbZLhNdVposS95A/BNuSbST50TX4jvfNjcdTW+0obOSM0PYtQydQhM0aqRj6rfdew71CK2GW1gFwn6X2R0tNKh40AZLMGWOM4A9jemAwGFQVb06iV4IqYvj+N3OIZej4zgJmWUOgKNaSQtQkY3V6M0tHwmrB3KbyECOc7e0FkMnZgVkcWb3HKiNgvdbS8AV7VayL3W8DPLXOAegQ739PeJPKl54FnLahl32bFPS1OstJ2SJT22P/qJGxiL+LEdssO2c0ARlwwq3YlBpf52bnQ1yur++Iy84WPid702KPlqp94SgcFwemPKe+CJM0yzi7v4+yplCxg== 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=pa314vjLTrlCI4ZsW8ad7qvIzY3kOvCySH9VwpWt/dI=; b=WfqirMFDGxPSYiwz59uGe4nxIGEpI7bs0WtZmJFEHPbu/cvoReM9qDkrhuHPriqSfyvSMTXq+tQIvFaONniMJ9wn98C95uRec22u7A1pIWAN2cJyJ8l4/lmJHmdBSDB+kYqgOllrnvrV7xUr1XpnMJF6GYzvR2+0Nqr+BehxlbstxHylVUqEM2SaXcpEhLmfXtvzTByzboq2bNRazxsl4eXYrLWuOGqIACowzlQd4YnsW/9A2lpuriST8Hp/iugx+49ifQ+Q7krUUpVb3HqknJvJrHyrsVi4neEa76tlBumu0OghD4Aq7sB61he5vzanAegaa88y8Ig1dvUL9vJ8Mw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=pa314vjLTrlCI4ZsW8ad7qvIzY3kOvCySH9VwpWt/dI=; b=ksQdYWq2p8FMOKhiFQtEk2f0lHpyxkPs98qqMfQOypvmIKg54UGB+E5tvjx0uKCzHmyl6vrdJ1t6GTeV9YL9ITts+G2vRebK8lRCujt+rRoPfdH4FhrTJ9mR44Up1mYDKDyW2qcS24NG1yBAPukRZUodd3c0255YJq4csYhJddA= Received: from BN4PR10CA0019.namprd10.prod.outlook.com (2603:10b6:403::29) by CY4PR07MB2936.namprd07.prod.outlook.com (2603:10b6:903:2b::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.23; Mon, 13 Jul 2020 10:06:08 +0000 Received: from BN8NAM12FT026.eop-nam12.prod.protection.outlook.com (2603:10b6:403:0:cafe::d8) by BN4PR10CA0019.outlook.office365.com (2603:10b6:403::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22 via Frontend Transport; Mon, 13 Jul 2020 10:06:08 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) by BN8NAM12FT026.mail.protection.outlook.com (10.13.182.202) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:07 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Yp013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:06 -0400 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; Mon, 13 Jul 2020 12:06:03 +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; Mon, 13 Jul 2020 12:06:03 +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 06DA63qp028627; Mon, 13 Jul 2020 12:06:03 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA63gF028626; Mon, 13 Jul 2020 12:06:03 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 1/9] usb: cdns3: core: removed cdns3_get_current_role_driver function Date: Mon, 13 Jul 2020 12:05:46 +0200 Message-ID: <20200713100554.28530-2-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(346002)(39860400002)(136003)(376002)(396003)(36092001)(46966005)(70206006)(6666004)(2906002)(70586007)(1076003)(86362001)(478600001)(82310400002)(8676002)(4326008)(107886003)(83380400001)(8936002)(36906005)(356005)(81166007)(4744005)(36756003)(110136005)(2616005)(7416002)(47076004)(82740400003)(336012)(426003)(42186006)(316002)(54906003)(5660300002)(186003)(26005);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39a91f26-aa9b-4ff5-68bb-08d827145ca7 X-MS-TrafficTypeDiagnostic: CY4PR07MB2936: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2582; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 1rofIEEVIgdk3MnE148E1tUJEzdsabxNXhAZ4mr8f4brnMWGkjvn3MYD3gbLduVG6MEgsi1/PCDJmFoQCjdCA1wrYZMrC7galuig22nUFAq68gazBCCUCRj6qCvaEbia1i41po3XsSZMbghybgZ27vHA7xeGw66efYklO/nLYqQo0yskAY7e+C/N6PmjiMhU/ynJwgSh6AS5VSJwIJ51SikFWd54yOcgAm3e9haPGXm/mNI3Hp2x9reH0eOH7kxSQo5hKQNE14UMeJG78AzwyTWNyLU/i3XtCHKkRa4bB3B6afE13WjYL5E6Z29gyz+2PwEJucWn4gkg4RD3nFiulSeyflivTUH97F9gClkMwxH7QWt5NboPq0vzFTRpe8WwcfQrXDvqbwUdZov2muB8aa5l3Qdms2f5C+HB+Y2k3jQ= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:07.9869 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39a91f26-aa9b-4ff5-68bb-08d827145ca7 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT026.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR07MB2936 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-13,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=827 mlxscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 59e5e213a99b..1f77fb5aefbf 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 Mon Jul 13 10:05:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659273 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 30817618 for ; Mon, 13 Jul 2020 10:06:51 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0F8A92083B for ; Mon, 13 Jul 2020 10:06:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="doS/uECG"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="M7Hstm4g" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729609AbgGMKGu (ORCPT ); Mon, 13 Jul 2020 06:06:50 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:6820 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729565AbgGMKGi (ORCPT ); Mon, 13 Jul 2020 06:06:38 -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 06DA36GP026914; Mon, 13 Jul 2020 03:06:12 -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=zi89usVL8YiHCSsDGGey2Zi5WPZ+2wMY592+ivrE6Nc=; b=doS/uECGA5LDWIEr594RsRvQu+w7c93RJi/ECryJR16EEvgZ8SwYdgd53kgj+d9kA0Nc kiHU3VgZ+dy9xHuSz9vjHHxGS4Riz5LfScLggSOiokbBYXKZQqlA++EX5OEVDL0C3FKI plq0KEmCHyymSC5UwV8ZsErHlBRPNoCsXeM4xU+TqKIprCne/mzq4lJlYALWH51PlB8P viyOsCp9o2A0HsnDthhmszsOyuI6Yac1sqbBwXST+mQkZS44mROyPAoy1GVAXY6gCbtQ yH2NfqK7B1a3Je5dv38UkoLd/Np5+MDwBfTOj5PoO/J3EIQ/CIiZsKd8AaiY0P4BWxHP 4g== Received: from nam11-bn8-obe.outbound.protection.outlook.com (mail-bn8nam11lp2172.outbound.protection.outlook.com [104.47.58.172]) by mx0a-0014ca01.pphosted.com with ESMTP id 3279yud6c7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:11 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=llREbXGf+sX9T5JNRVVSB9X+phLlSIHp8WY3VGynSdVwYMUljP3RLS27Y9i0BRFppbCtKzoemfooL1nlO9C3VjJseHbOZukIxPGgBP8eIAEyJPZQl01k9B0ORZMGEoMUr0QJ9HKIGmJouThG27KNuXvzW9qrlkw+WPiEJKNCIb4E3rk6sNcQgmb1u8r6k/vmAXaOSWIxT/7nKvaJ6au0ZFY05NyeoBw7EItKdTTbgiuvpUdqmvjSf32Z9le5FWRI+y9eIVGdLByqhtBTz885q4HS1MuEmMGdNB4nAZeH9RZ6u/DrjnfDf0Bm7V+0MgTYXKjO/8NZZFyNgh9i24wUEg== 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=zi89usVL8YiHCSsDGGey2Zi5WPZ+2wMY592+ivrE6Nc=; b=AkDpG5Ap/YrR8AhJejTkAVqGEVjVDCIQhTEcPL+1tAwjEVFXHZiO3PA4V9Gd1l+QVWTWC3d3iANFoSwyKQcwcLL9dEel3dqgBX5kb0qdblMTQzXYDdnoDr32ElYCeyhGFfggacmJOBJzxp90yZL+d8JTxXGfwWnq2qPm/yeVTLzFdE6cvskUMwYMbV2rBWdaa255PgQWdqv04SJVJvI2RhpY63tNzeXUQz2MIOIw5Imp1/j8X8O/r8ykDCllZj1d9pxDOK5QDKn+MhYK4EVQuq69i7RoedgeD5J1Qwspki0QyKvItjqT37h5OHtMVVaIN9Xufh6mCX/dL3ACzCkliA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=zi89usVL8YiHCSsDGGey2Zi5WPZ+2wMY592+ivrE6Nc=; b=M7Hstm4g2qUCExQBhIPxtib6BgRzGycUtxFJAls0tA1t5JV9ECc4axs8lrEXCZM8gOiFxY2l7uTBSTy/rD2aCgnwUUkuNv1AiLtAhfHZ+ohdAVi15HU8QCM1HI4tBpGDePRcgz0LiIv2fB7kykSzHxH7VuA7GKYdbAQiTzZNu4o= Received: from BN6PR11CA0029.namprd11.prod.outlook.com (2603:10b6:404:4b::15) by SJ0PR07MB7663.namprd07.prod.outlook.com (2603:10b6:a03:28b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Mon, 13 Jul 2020 10:06:09 +0000 Received: from BN8NAM12FT010.eop-nam12.prod.protection.outlook.com (2603:10b6:404:4b:cafe::d0) by BN6PR11CA0029.outlook.office365.com (2603:10b6:404:4b::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20 via Frontend Transport; Mon, 13 Jul 2020 10:06:09 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) by BN8NAM12FT010.mail.protection.outlook.com (10.13.182.62) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:08 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Yq013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:07 -0400 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; Mon, 13 Jul 2020 12:06:03 +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; Mon, 13 Jul 2020 12:06:03 +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 06DA63g3028631; Mon, 13 Jul 2020 12:06:03 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA63Ts028630; Mon, 13 Jul 2020 12:06:03 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 2/9] usb: cdns3: drd: removed not needed variables initialization Date: Mon, 13 Jul 2020 12:05:47 +0200 Message-ID: <20200713100554.28530-3-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(136003)(39860400002)(396003)(346002)(376002)(36092001)(46966005)(5660300002)(36906005)(47076004)(107886003)(2906002)(1076003)(82740400003)(8936002)(42186006)(110136005)(86362001)(356005)(8676002)(54906003)(83380400001)(6666004)(81166007)(478600001)(336012)(4326008)(7416002)(316002)(186003)(2616005)(426003)(70206006)(70586007)(26005)(36756003)(82310400002);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 368351c2-8120-467b-e1bb-08d827145d34 X-MS-TrafficTypeDiagnostic: SJ0PR07MB7663: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:160; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 5Vu2+es1PjQhLHll4YoqzXG3Xa0yui7YJkhOf58u0FFNHKWfKc/Z5y0w4cArKEgD/dSTyOVQsiUkRM/3cfsiAAf9oY9qOef/vSHCvJe311igRhAoHv3S9ON5BXTGMffLgmOImBxvlpsns/3g+yMTzmPwupJShiVWmT8K32OYImKrvhKopgg/cDX3LhwB9RRFyGPsGCf1dJCPqDllif4vQs7OaEA3hGhasYV0tkRXlUnH62YdAkaJO0b/PpfD5YrLo8IjdVeYIqiK3qFEN0Mt8qMzJOxhfF466pR11madVcPgJDtrHOb0g+z9CG4nH9SZAeAOm+rMv4PnqLbUEl9K+2h4Nfu1Pv8/ynLPe+NC8baA+Y0aVnnNxVzMBiff9BR6aWQi/l5WJEpDGZQ66+c3i5UR4cT6OsT452rgvEbae6A= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:08.9231 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 368351c2-8120-467b-e1bb-08d827145d34 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT010.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR07MB7663 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-13,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=564 mlxscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 Reviewed-by: Peter Chen --- 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 1f77fb5aefbf..c498b585eb13 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 Mon Jul 13 10:05:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659271 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 28E8C618 for ; Mon, 13 Jul 2020 10:06:49 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 08DA82084D for ; Mon, 13 Jul 2020 10:06:49 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="SE2Cl7BK"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="KD6S/MNp" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729695AbgGMKGo (ORCPT ); Mon, 13 Jul 2020 06:06:44 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:40862 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729680AbgGMKGk (ORCPT ); Mon, 13 Jul 2020 06:06:40 -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 06DA2Atj014731; Mon, 13 Jul 2020 03:06:13 -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=TDu8WacNDgxsaO4CCdNw1INAvayJRUr/Z+FXhQ/VFtw=; b=SE2Cl7BK/TcSOK/GNQkh4zTJnuSx0jkH7AV2BsKdHry1Fwz4oP3jB7Oa8Vd7ITJtJ725 33mJKE8ImRKLra42LwNRIlV5dY6DKCsuBZkGeZVdbkl3MxX5Dkh6bdE8kwJOAZZ4ch/7 dv+ClLpG/KC9oqwbhTgphIUxoyP1phjJL2a2kTKaAQbUbF9ogkuTJYK7GlhKdd5CTr0L 8ssG/mFaFkpqYnZi808ZhBUo/aZkD9GB3pN1WvvbR4MzWDw0H13pJZIbw3G80a8IsiOZ x8DXlAuxKVFC2bqCZyb55ItKuawhnjp73A04h1tF11x8sMij1Am8DVBJIo4FcHkdJf+v Mg== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2174.outbound.protection.outlook.com [104.47.56.174]) by mx0b-0014ca01.pphosted.com with ESMTP id 328ftugxdm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:13 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=edyeHpkL3bR5kdX30mv2X4qFG7MkIokoAQ7JmgNnfB5X68bn8X3Kd5DsFTWwdRhR+kqG29VyVwQ3reFbxMhyvZ42B7V6teJkeQ6jTHHr6DY7eqfPWJE/KoiVUZnqWCHXaSJmnkJgw+Cqd96JCDs5B6tVmPSRRMD5rql+6DTubhs0dVi6kpAD2TewjGvjqn1kPSXpomoO36BuCMy1dZNsGktQpJZdjxNEmYAppKtbhqym1+vHTicey9t7Ym5mJ+p3GHkur0di9ONe/avtHswwVvz9he0xTRDoYHCKg/iBkmJXQ9z7efOdQQLbwDTJ1ZP3UuRE4fx1JdPAwLv90mUZhg== 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=TDu8WacNDgxsaO4CCdNw1INAvayJRUr/Z+FXhQ/VFtw=; b=YQaN4HF/Ppc16xGZsVywwxY3uAObrPxsDRgbKxQNyt4DX8plH3yUzBTj/6tvWJmwwzD5boJe3VweoNDI3ZhSK+clQYQid5YjdP5SvwhoI4SKtaQlwPhL9mo5U1OEejlEmO4R/vgJcg4rM9J0Y8ze1bVHAD1mpCjrCku/UrS1z9VxU55wLXEv0+A+lR+Nbn0WX4gaz8neNippfaHpLuRxZPZqIdwAVqs7sPTyWb6TKYQ+INZ0OiCgfRj9QkPp4Pmlh03y4JnhTQxWs+O300YZKgMX06fmuq1sUcgfZBVedXcSnGZRVuNDnPthih5/jl8mQkXpdWnrZg0L6vSFqvESmw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=TDu8WacNDgxsaO4CCdNw1INAvayJRUr/Z+FXhQ/VFtw=; b=KD6S/MNpE9wuoSNZ6ar6dmwLkD91Wdw8hRqqXHMWhS9uZhUIoXBI4rm+0K44KBmJmW/MIzkypXEEN1eD/H2jgbbSD3PHlvby4QTp4dS4SaQ5ahD2a5lN0FsQF13h1TudYBfH1/Auvw2ga5XJsUmO/aw9gBPMAQb7ehG4didMDxo= Received: from DM5PR05CA0012.namprd05.prod.outlook.com (2603:10b6:3:d4::22) by BYAPR07MB4759.namprd07.prod.outlook.com (2603:10b6:a02:f2::25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Mon, 13 Jul 2020 10:06:10 +0000 Received: from DM6NAM12FT046.eop-nam12.prod.protection.outlook.com (2603:10b6:3:d4:cafe::6c) by DM5PR05CA0012.outlook.office365.com (2603:10b6:3:d4::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:10 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) by DM6NAM12FT046.mail.protection.outlook.com (10.13.178.142) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:10 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Yr013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:08 -0400 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; Mon, 13 Jul 2020 12:06:03 +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; Mon, 13 Jul 2020 12:06:03 +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 06DA63Oo028637; Mon, 13 Jul 2020 12:06:03 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA63LA028636; Mon, 13 Jul 2020 12:06:03 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 3/9] usb: cnds3: drd: deleted != Date: Mon, 13 Jul 2020 12:05:48 +0200 Message-ID: <20200713100554.28530-4-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(346002)(39850400004)(396003)(376002)(136003)(36092001)(46966005)(70586007)(110136005)(70206006)(42186006)(316002)(26005)(2906002)(36756003)(426003)(2616005)(186003)(36906005)(107886003)(6666004)(336012)(82740400003)(8936002)(5660300002)(7416002)(47076004)(356005)(83380400001)(4326008)(86362001)(81166007)(4744005)(8676002)(54906003)(478600001)(1076003)(82310400002);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7a8e6d40-8e0e-48a7-af36-08d827145e14 X-MS-TrafficTypeDiagnostic: BYAPR07MB4759: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2887; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ojE2KTELyCcdyl8z+OroHKdtk+qrE0giolCI/DvdC3STLrstlV+dOQ2O59sW4r5gcFkAQCoAKdp/HVTRclRieHCWvZx7Hxtc/gW0ptB/0CkgCYVekNVEMxG2pZXKeLYMy8y4QdneNjy+jVh/b3Li9lcaL4woQ4ViF5LxIOCEnRGVvRu1Rn/kj/Qg1X6P8xlXV5LuaV0LmDAgKUNROOHTu1Xi/psEeu6JKzJNA3T4QR4Y4+4FpdGn6SfzGR1QyAtuCqsv2YwnXSeI5JweOoOZddL7dAqrKCbeI3/1G2yzfMSt+cjxU69EwkbltfJzTtcHZufNr9zCVuBqtmKBrNdRl0NbMCwzOm5OyQ1UzE5eVv+swoRXIGDPbrx7xOJuK7nCRChfb8vrmIfpNPkr6npzeJzjZBhME1sseRcL7tLUQFI= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:10.3458 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7a8e6d40-8e0e-48a7-af36-08d827145e14 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT046.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4759 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-10,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=787 mlxscore=0 phishscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 in cdns3_drd_init function. Signed-off-by: Pawel Laszczak Reviewed-by: Peter Chen --- 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 Mon Jul 13 10:05:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659281 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 8601F618 for ; Mon, 13 Jul 2020 10:07:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 67FC72080D for ; Mon, 13 Jul 2020 10:07:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="mz/FmSZF"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="YaS1+BgM" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729721AbgGMKHA (ORCPT ); Mon, 13 Jul 2020 06:07:00 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:41220 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727035AbgGMKGd (ORCPT ); Mon, 13 Jul 2020 06:06:33 -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 06DA2BJS014737; Mon, 13 Jul 2020 03:06:15 -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=mz/FmSZFTUmOLTotGX2Dzdp6gGjlU8Wuru8Li2ktRLm/03XVD611VKaTF56MUjCGLePT DIu3US29r2We3JniATTVtFIy0xYpzvw+QXRu03TK9TwDebNlhuWT8zjRq0sj7evTLxcB w9/qht/ToJlhZFs/S3GZz6uiTeU68ZwWLAb0SK1sKEwIAPPwSMI0ZfrOd5SPsr5DIJXx yVG/MaMIIpBGVbgcR7LMjcI+NnCvFaBAtF9CNxq7qxIkQNPrZSOZ+meHLsuLp1Tmbqjk 9eldkVpUyjzfNfUI7Iyo802HHcmyg62ycqvdAoCAw3p0IXqvHSy5+gKFCQhQlE8Jcpq9 Hg== Received: from nam12-mw2-obe.outbound.protection.outlook.com (mail-mw2nam12lp2047.outbound.protection.outlook.com [104.47.66.47]) by mx0b-0014ca01.pphosted.com with ESMTP id 328ftugxdn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=UaGhtK9/jEy188DswnHLNc5uKbQSB1OpBDslVluB0GyjD/6NqUQj3dG/Cn1cCybiSPmHLPminV5jcQ8Y8g52EC/hwoI8I2au2h5RIZnfXJmj6fOXK/yjUDewcbDUOoTN/P57JVCToUAy4qyPzLhowa2ifS/uTxB9tf+jRvMPgfQ0NMY11/ES5yQ0S2jMY3BOp22qftkAu1nfYaJMvxsfEojhgjz5qI0NC+MPIhTLBNSgNl2X8EzbuTBeIqFSZDo81MI2Va9P9YJgepOtlMh0VHN5MrlCc/fIrV5Z71oDj+QbkSr1eisUXK9YIKBjnWaW3+AVVZLjxof/WQtF+Xetyg== 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=OlqgqRN4RgJEBbQ7Qdrwg6tTHMRd7T6EnBKs1fBXspOnK/ubQirQaTefAP+Xh8ILQIQzTVxcu1dpWKsw9U7Jut7XYl/wUawBTsgMtjq2EzJheDpL/OFfp0e77aSUHSHpHtQlnZ1udIcEsvCMtIPiH/dtXcAgN3zSJkds6utI+MxsXO7xp7DePP/S37D5bRNIQWIgsUxXCy1JR1cucYDLVSnTV4Q+/U3EMUrN72omNhtD98ZsKCK/7rOHzxHEhGIbc9/aM5MddW6Xp93ag0Vc2T6QkIOSHfo13Z4Q9z2/ZI1Zn1mWRa2QpJcBo/gSsqMmismWoQP7FswJ51/Un4rlkA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=YaS1+BgMe6CU6MBgSmixKMVRpo91nH6DicWsq/1RQoF3acqSkzaDCAU691ctIg1r/B2vSk6WoZYiOtkJVPBgvS26CdWbl9bSlwuOp3RUYuVfKwiTWc4MqaNG9Ux808gFSs5d/T31TJ2LKL44UhBBwPkp7vwj/nwS/zqS6wRG8e0= Received: from DM5PR20CA0013.namprd20.prod.outlook.com (2603:10b6:3:93::23) by BN8PR07MB7075.namprd07.prod.outlook.com (2603:10b6:408:d6::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Mon, 13 Jul 2020 10:06:11 +0000 Received: from DM6NAM12FT016.eop-nam12.prod.protection.outlook.com (2603:10b6:3:93:cafe::93) by DM5PR20CA0013.outlook.office365.com (2603:10b6:3:93::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20 via Frontend Transport; Mon, 13 Jul 2020 10:06:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) by DM6NAM12FT016.mail.protection.outlook.com (10.13.178.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:11 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Ys013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:09 -0400 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; Mon, 13 Jul 2020 12:06:03 +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; Mon, 13 Jul 2020 12:06:03 +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 06DA63kR028641; Mon, 13 Jul 2020 12:06:03 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA63OL028640; Mon, 13 Jul 2020 12:06:03 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 4/9] usb: cdns3: drd: return IRQ_NONE explicitly. Date: Mon, 13 Jul 2020 12:05:49 +0200 Message-ID: <20200713100554.28530-5-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(346002)(136003)(376002)(396003)(39860400002)(36092001)(46966005)(82310400002)(8676002)(70206006)(70586007)(426003)(6666004)(86362001)(81166007)(4326008)(356005)(5660300002)(186003)(36906005)(478600001)(8936002)(2616005)(7416002)(336012)(107886003)(316002)(36756003)(26005)(110136005)(54906003)(83380400001)(47076004)(82740400003)(42186006)(4744005)(2906002)(1076003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 55f83c1c-20d5-45ab-ffcf-08d827145e7e X-MS-TrafficTypeDiagnostic: BN8PR07MB7075: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:469; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: eHlvDHrJ1zYHJBahJDLrc3I9pQdGgBkd5oKRwGWK+Spwx+tEtjLgFIDupushKTYE4/I8YS9b35WZhU65kmQfIeYXrxk4kk1TVhrEHFRvkZU5vn8Wt981LPOwT2lgR4f4EnBCmy8aI+Yavn8tl72Z7roHRA0rBaFbpi9bqMNuIj70HCa+fx6LRF2JTg+o6xx4ED0nSDwjZ9WjB2s5bmRI5NP4ezWqigMNWgO3ZcwyJf2cIAGW3CNVbYt5HZz6xCOc19btR228P3YfAQPYrTJth8diSPtSytIv3zJbw3Qlr6UXwqTRLyU03Ymhia3PjxzhYVQ82lMXjGSjQjGMEANB+lrLMJ00Gt5bJbLR6eudEkoDM63ZUcrPhEetaRapfj+BdklW2554DNm/d5OjZvtT67utsWoHiFHExoW3QmO9lgI= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:11.0356 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 55f83c1c-20d5-45ab-ffcf-08d827145e7e X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT016.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR07MB7075 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-10,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=574 mlxscore=0 phishscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 Reviewed-by: Peter Chen --- 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 Mon Jul 13 10:05:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659265 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 9D7DE1510 for ; Mon, 13 Jul 2020 10:06:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 7DF852077D for ; Mon, 13 Jul 2020 10:06:34 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="c++Il7tU"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="o/3zGxM+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729574AbgGMKGd (ORCPT ); Mon, 13 Jul 2020 06:06:33 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:43746 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729127AbgGMKGd (ORCPT ); Mon, 13 Jul 2020 06:06:33 -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 06DA36GR026914; Mon, 13 Jul 2020 03:06:14 -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=c++Il7tURbmxdJDcfCbMgQ19+ASpQM+rZMTwdxsuxR9hlThxAZLquxQJV2zTmEtnapiv Bq4VZmQiKfz0dZ+WIE2M9/JXHIqoKSnFdbg+xSm7+8Lzd2BCQ8AZu34j8uuuWnSSyEx+ QEf8W323nPxt3Kl+q/6aQHDM/jdgcH5T4c1Hl3h1mjnmLQ4so2kkJD6V2XAJe8gIrKNj HaFjSjEmIxwrs/j7NIrxp9lOe7Uca8otyaY/7v6HRJZW/iD1gHHxh+HLn1J59clkeic6 Ci08TgM15n5A/25dNGAga1qF4gwz/Fe/nkTXDM/0e5rSFiaXTQlp9Hq+mRHhxwT2Y/2G Gw== Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2171.outbound.protection.outlook.com [104.47.55.171]) by mx0a-0014ca01.pphosted.com with ESMTP id 3279yud6cd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:14 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=fiBTJKjNR7WO1CwK3BTDCDeuOYoBEx4Ji9tf8szltnm0YeauAC7hTMkoQEWsHcNlOZvI8CHW0SzlTocAdzxAAVj09JQ/QkE5Q6oZmXudv3ddckz2ZKFsXvuCHVr9RzbecgvWR3HamI6MPqW1zLaERJDGCeIrrFEUTHUgIRAaiE9mBu3ljRbAdS+9eVjzSMqBCHWFloNfWe0a8kiM195Y9H3LtmGGPqvmzA0+9pezBv0WCwgZHOIUXYI0AyVLgK6I7j+8AEvgaknBOF+fRXeS2Bq0KSZzFwtu4Qtzhg2QTl7f40tpXxv2/o1GOrzCecXE43eX1vKWnpast93ePp/Qpg== 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=jTvuB2lCL1FhZ65OeL43Bta443V0yElkbxkKeRzp/ceSHGGNGyw0iLWW6MS4wVlOm9DHV7uJWdNo1MHejaKT3SUqRGFzdRXrI6Qsf0WruQT1GbrnCsNp5JN1yuFNlyxpUsg0LRzpoA9iqHMz+Dbe55XdKUJ+3OU86pjCOV8PpnOR86A7CUHg04EmfULWD8yomLLJb5Xjjpaaz0xn6RsZi7j+nJW8HaD+vPXDzUZBxwZqM3EnKPEXVZj4nCJwueZCAjf77HkhzUdiFkHzZlunvz4LYkdIebfccO3pdPggCF5vQbcHHXop3W6BZOY1Pr/2DoRIdvDcOZyGjmkcAkg50w== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=o/3zGxM+oMxUMBfqRFILNjsc1QFxF01e8SqcfiFxERl/AWjAWhU+s9ECYKaVGrEFX1Pku77/YXbyoEM1tYaJDpxNT4cmrta8cQooIoKvFHWt4GG0pg8S9eDthh0wmS46x1vshJ8D9WyES2tziWOlmLc4L8LwF5x5HCUhsWLJ6ag= Received: from BN6PR04CA0082.namprd04.prod.outlook.com (2603:10b6:404:8d::32) by DM5PR07MB3594.namprd07.prod.outlook.com (2603:10b6:4:68::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21; Mon, 13 Jul 2020 10:06:12 +0000 Received: from BN8NAM12FT062.eop-nam12.prod.protection.outlook.com (2603:10b6:404:8d:cafe::cf) by BN6PR04CA0082.outlook.office365.com (2603:10b6:404:8d::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22 via Frontend Transport; Mon, 13 Jul 2020 10:06:11 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) by BN8NAM12FT062.mail.protection.outlook.com (10.13.183.65) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:11 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Yt013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:10 -0400 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; Mon, 13 Jul 2020 12:06:03 +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; Mon, 13 Jul 2020 12:06:03 +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 06DA63b3028645; Mon, 13 Jul 2020 12:06:03 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA63DA028644; Mon, 13 Jul 2020 12:06:03 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 5/9] usb: cdns3: drd: changed return type from int to bool Date: Mon, 13 Jul 2020 12:05:50 +0200 Message-ID: <20200713100554.28530-6-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(396003)(136003)(39860400002)(346002)(376002)(36092001)(46966005)(82740400003)(47076004)(5660300002)(8936002)(7416002)(316002)(356005)(336012)(82310400002)(2616005)(8676002)(81166007)(4326008)(426003)(42186006)(83380400001)(36756003)(107886003)(478600001)(54906003)(86362001)(26005)(70206006)(1076003)(70586007)(6666004)(110136005)(2906002)(186003)(36906005);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6e88e59-8504-4a98-0d06-08d827145ed9 X-MS-TrafficTypeDiagnostic: DM5PR07MB3594: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:2399; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: QORibwCv1ljgeDoptmtBvO5DAPfTPyhInPBqxTfec/MSNWOk//vj6gPUYP7vgP1dNvuV/Zu+U8fcAyuqLWJNRF2OgTcNZA6+4raJCIrkpPpbtqagaW8Vx60bSc7zDJ55qKwonEyzFViMYTM6ITFVDPJhXxwhS2r27Wqrp1eMAJupS5LI0TeBRBNfkHMblklenC2JSreN9tceBymOjyxsIEHwkSdBI0BwEwJiTZS8BY3v4mEpOSM4YWGao/W/kFJov0869DjvvEGXDPqOgBpMH3ixUoNciJyjWEKBQIY7/qdiL8gjoXGImCfYDKPoL8RxBxXd1+43pjBGnuWZbk3tvKnuAqMAY9XTn1FdVbVlc5cwNMBPHxFHPdAbNxHiJ6SyQhKdN7XDvtFznvYtFO6ALosZCRavs47D0YzlL9UpPVk= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:11.6757 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6e88e59-8504-4a98-0d06-08d827145ed9 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT062.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR07MB3594 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-13,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=724 mlxscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 Reviewed-by: Peter Chen --- 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 Mon Jul 13 10:05:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659269 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 CFCA913B1 for ; Mon, 13 Jul 2020 10:06:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B167C207F9 for ; Mon, 13 Jul 2020 10:06:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="AFJxSlm2"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="OXK6Sl9L" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729678AbgGMKGh (ORCPT ); Mon, 13 Jul 2020 06:06:37 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:10254 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729659AbgGMKGf (ORCPT ); Mon, 13 Jul 2020 06:06:35 -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 06DA359s026892; Mon, 13 Jul 2020 03:06:17 -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=AFJxSlm2w0FOLFUn5fz9OhRXGFBiGng+bw3da1hc6AEQs1Mz7LRa3fJ7WrZAdft0FArf 9AknlZ4vK+E8SB8/22tFo38tQVGRA8suTeUAvKql/nF9DA0AUMMGhx/kbv2zPFAXPgRy T5duNq+8cieztQm+EncMRPrduLjf03U5NL9jOlMIeMe49XarnmZiibtxnaBK7oF2posP Uerg+ghQgDdwO1pCK/sf7oQ9x3ydDjNIc9qbDMmbOnWFe0ietpXpIH2mTNFcQ+dhOgAC YqLFun1xI1IjfXtAcdD6yuGHn4+emolAjO3GqCl9aanlt/zmg8UxUQI257jvHrz18gFF KA== Received: from nam11-co1-obe.outbound.protection.outlook.com (mail-co1nam11lp2176.outbound.protection.outlook.com [104.47.56.176]) by mx0a-0014ca01.pphosted.com with ESMTP id 3279yud6cs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bk+YClGTVhyA5V16JUOvbbvnW1rgZmFxMLQvv5Crou/3YERUGUKvip67q70MsS8U9aGdc1dBtODaUERZcpIISI6ehN5S2dTgWZPiyW3UCYxkcUVanOFPvjnHql7Ynj5tecKmH3jHAwfSYXi8LD3rh9pGcmzcixkOc9YtbaY4uW2zLuppnvG+IQNSdp1ih+QZclOzwJ6BCCq0LGwHcF7cddbu6fji2CdfeSHppJOI0fFdYMVzacYhjjFBwBEVSC39i9lNq54lYyV8Y9y+g6DbksHdTrnurd2PYR5FhNC2j3xQ6dHM6oTp7Mn/ZSxUc9RBjcHyAna6FBSjgQYYMquJlw== 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=DzRPti6ePFI1sCWMFLGYxpAzR9cHoLGehX81K57QclrtoNYGfmcTcH02ENXkXTywm9HsusYOGGCspsF35F+Vy4jXHKdeKYV8DNGQpnuMq12sOjp0boAMvgA9mAq0fnbCaFfnL1yUkgN4zLxAhr0KvW+UB3obui/B/i62ABt9k98EZXwAXZmCHQ1uJpbEvP+w6XSvSxw+XNbD2WwFmD8ttGdRhAY5+idQ2BNtKb9V710We768nebW1Bb7+POH/g1pFOk3WeGvoTyVkLUp2N2lx/6o5+iI/7e/0vVlzc0Dp6G/mr3DtqN70mhWClCh4PFSAIF/uewcJLKYQAm8Gidd6g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=OXK6Sl9LCVeNpraMakA/4XnyGGiHKdWgEBgfL9bVqnTyhkJiLs/a/xX5p9w1QYh2ORqfSOqkp8R2s4qzHa+o72SofCPnlVs6ph1iyonINAkeRRkx+if3H2PnTa33hjOw9Fj7DwkL7DLFDrdtWfkFilfCLxa2IjQqwPSI/6HqRkA= Received: from DM5PR15CA0035.namprd15.prod.outlook.com (2603:10b6:4:4b::21) by CY1PR07MB2668.namprd07.prod.outlook.com (2a01:111:e400:c610::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.24; Mon, 13 Jul 2020 10:06:14 +0000 Received: from DM6NAM12FT012.eop-nam12.prod.protection.outlook.com (2603:10b6:4:4b:cafe::1d) by DM5PR15CA0035.outlook.office365.com (2603:10b6:4:4b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.23 via Frontend Transport; Mon, 13 Jul 2020 10:06:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) by DM6NAM12FT012.mail.protection.outlook.com (10.13.179.161) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:13 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Yv013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:12 -0400 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; Mon, 13 Jul 2020 12:06:04 +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; Mon, 13 Jul 2020 12:06:04 +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 06DA63du028649; Mon, 13 Jul 2020 12:06:03 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA63tN028648; Mon, 13 Jul 2020 12:06:03 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 6/9] usb: cdns3: Added CDNS3_ID_PERIPHERAL and CDNS3_ID_HOST Date: Mon, 13 Jul 2020 12:05:51 +0200 Message-ID: <20200713100554.28530-7-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(346002)(39850400004)(396003)(376002)(136003)(36092001)(46966005)(81166007)(478600001)(336012)(356005)(5660300002)(107886003)(426003)(47076004)(316002)(54906003)(42186006)(36906005)(8676002)(82740400003)(4326008)(110136005)(6666004)(26005)(8936002)(36756003)(70586007)(2616005)(186003)(2906002)(7416002)(70206006)(83380400001)(82310400002)(86362001)(1076003);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 47c7fedc-54eb-40db-c61a-08d827146028 X-MS-TrafficTypeDiagnostic: CY1PR07MB2668: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MF8CgGT2d+ZGA+RpX633TKV20joiX7dS18atP/YmrEDthuWlybCypnoN70s0nqbgzAJl4x15jQzFfRjE8AuLlOUm8TP9CfDV+SqJIVHVVMw82sfR4/nlG3a97KUTquk2KJzCC26ujMypuTUpYR26qK8VjPhxr2DKPwjRdlQ7Udj0aQz1VWPMWi9v+nXiUxsmXAzQmkr/JATDtBjfSfeVK5jsb4ykXaetuilBAfTjQvQ9Rl8dESx0XUhfTCphC0WkqPgdWyf4yf7XwcPo/fQKJqr5pAY4VzFHSq/ES0uGLk3dsp3WK9MkENWIdvaMdt74T4mXsGF40op9XIkyQkNcZBUAwabSkvHswMs8gw6tqbb0Kn4jC2abQOmmnUvrbSYtiV9K8YgxTfc9SkzLNEUx1Pporh+YU7762DGbTDezqUE= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:13.8329 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 47c7fedc-54eb-40db-c61a-08d827146028 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT012.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR07MB2668 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-13,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=582 mlxscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 Reviewed-by: Peter Chen --- 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 Mon Jul 13 10:05:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659279 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 70F48618 for ; Mon, 13 Jul 2020 10:07:01 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 5315B2083B for ; Mon, 13 Jul 2020 10:07:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="OawPxiUl"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="fjrgGLn+" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729715AbgGMKG7 (ORCPT ); Mon, 13 Jul 2020 06:06:59 -0400 Received: from mx0b-0014ca01.pphosted.com ([208.86.201.193]:12856 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1729534AbgGMKGd (ORCPT ); Mon, 13 Jul 2020 06:06:33 -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 06DA2AxK014732; Mon, 13 Jul 2020 03:06:15 -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=WZbSnjFEtsMI79U8CC7OJlmRdFqJ7SekbuTf/tWMDME=; b=OawPxiUlw7kMvxDhabpgQSDQ5o67VnI97ZTG6v1KE30SLUXtlSoJ3Hf+A6tjSQH+hqHD wt7e4IUGkZlZnpJ9bWdw3fICYmQ6q9URZolpvpgjeoq3srz/JeFALjkfLyulbeiY/m1+ 3hBEQ+VGOzOwEla+YfyWe+Hfuw3W975vAWI3wAyVbApWUB5W68QJjQcFa4TRlYrowA/F 5dF5MN7D6rglKF1TsrhQYLPklrc/bBqWxc8vH2ibBJxNFPFZs6OR9xZ+1uT5UrSNEAto v9IthEg4KabZsx1jgDM9MLqXNZLICRiJz8DtKMaTNXiWCZkF+25ieTL0S4WQKA9ICdZg 2g== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2105.outbound.protection.outlook.com [104.47.55.105]) by mx0b-0014ca01.pphosted.com with ESMTP id 328ftugxdp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:15 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=LUVVcvZ+95iNXMRD1bNGpuWHlg0Y7mizMXFM5pWcOWfGr6o/WmtxzjIH8EDFooMWHGji4gd/jigkoKRQGrKk1dZjodvhF6UDG65Mq9xrUBwmmfEbhrth7O9849Y9BmIWaXwXVvjPRYAKusms+CclsMWEK027iRQ0hEV3VpB1oVYCDk9ec8eCG3+OWTASZXHvfCutRp9CFA5vfw5ev/qMPdYcHZoFm1BIf4BUFY9E9HfE4cvBEoN3XDNZZGuLqDAJZI2OG3q0fp0tisLCasyqO1cVhvUIMfjwJgwrxx6YbfELkdv+vRsJGq1/Zxh4dTH2CT+vZelEybdaWr0IFXwOYQ== 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=WZbSnjFEtsMI79U8CC7OJlmRdFqJ7SekbuTf/tWMDME=; b=WWPskGeaDlSxOrE8rwVu3jMy7M5ZnWPrcch1DFT9QrVp4Hu3e/xo0NOBK2gF0lluxf6TFg8nWrc4ev+MvABrfR6IMK7CTLPPpwFAvkBCWaPouww9PqifD2FRh5Jv41b68xsDza1TcGWe39SNEO1Ca/qGv0PbUM8NncSTKCgG92yzOZxEK0nUfHCdV/71UqU2Bj5BN0SP/bPyQ7ch9HJUpIvfs6HIMlU9kN9fhhnhkO0J1dlbbgkaVpQdPxf/0n8owfNOUtVZ546Zzgz/ELcGD+gTw4wJTlz5JfFBwoWTuZt1+Xuvc0l9AOvYN4DIiaVnmKfx9gy6++kBIOIB3AXCVQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=WZbSnjFEtsMI79U8CC7OJlmRdFqJ7SekbuTf/tWMDME=; b=fjrgGLn+EeijJ1xvzFsMWZ2g2Yn0yUofwrclcBGPRSHRvGk1nUvVSXkelC2pvI2Co3wbDII4MCrPhgzafkjy1FaGbAeLygQkLvbFUIDB+xCxqTig6CVkhjZ8MQp6p0iBzafU6SpbOGWHZvaNLpOkOf2eWlBiF0Zu5PuXL4JTcYI= Received: from BN6PR06CA0016.namprd06.prod.outlook.com (2603:10b6:404:10b::26) by MWHPR0701MB3724.namprd07.prod.outlook.com (2603:10b6:301:80::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.24; Mon, 13 Jul 2020 10:06:12 +0000 Received: from BN8NAM12FT019.eop-nam12.prod.protection.outlook.com (2603:10b6:404:10b:cafe::22) by BN6PR06CA0016.outlook.office365.com (2603:10b6:404:10b::26) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22 via Frontend Transport; Mon, 13 Jul 2020 10:06:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) 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.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:12 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Yu013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:11 -0400 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; Mon, 13 Jul 2020 12:06:04 +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; Mon, 13 Jul 2020 12:06:04 +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 06DA64o9028653; Mon, 13 Jul 2020 12:06:04 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA64kp028652; Mon, 13 Jul 2020 12:06:04 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 7/9] usb: cdns3: core: removed 'goto not_otg' Date: Mon, 13 Jul 2020 12:05:52 +0200 Message-ID: <20200713100554.28530-8-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(39860400002)(376002)(136003)(346002)(396003)(36092001)(46966005)(81166007)(186003)(7416002)(2906002)(70586007)(2616005)(6666004)(26005)(8936002)(36756003)(82310400002)(86362001)(83380400001)(70206006)(1076003)(356005)(5660300002)(107886003)(316002)(54906003)(47076004)(478600001)(336012)(426003)(82740400003)(4326008)(110136005)(42186006)(36906005)(8676002);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c7e26fd8-4367-4e85-fe0a-08d827145f7b X-MS-TrafficTypeDiagnostic: MWHPR0701MB3724: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:820; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: 2bPHw9Osi3MBCVVVz+vHa03n3msvhoQOC6/QKJpP1gDf+LAsbi1HfGtg0V7GSXLmX1Ph60IxRm0IfWKSdKeT/HtX4DVZoSVL7de7ayQq1GbFxb+k/d3rX8lTqmnxDYAwm2YTqMjW9GhU8xma3D2OoZUbUNGhQZWnMJOvVdHlYLwVOMBLjnTDzLarjTk9/rYJg9vt166xHPRZ20uvxQb5tvEerM1JPDPOAIR2hfnFn7lubI7HaVU1Uyx0IGBV4Lx7MMyHLb7ReDtHPX+iUV5bO/0YrwZnmDEU/ezliKNWJfm/zYTfY9LsanaOMKFxm+tt899teEybdS5bXyl1GP5E6Riby/c7jwz/n4AWG4GNTxGH1iuCQeAIIsQom7wqfDTc8GsJ9bhv6upzhzG/Rdrj56EEtOq19m5f8zBVXmbscZo= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:12.7446 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c7e26fd8-4367-4e85-fe0a-08d827145f7b X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.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: MWHPR0701MB3724 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-10,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 suspectscore=0 adultscore=0 spamscore=0 mlxlogscore=756 mlxscore=0 phishscore=0 clxscore=1015 priorityscore=1501 malwarescore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 cdns3_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 c498b585eb13..8e3996f211a8 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 Mon Jul 13 10:05:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659277 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 C3A7B618 for ; Mon, 13 Jul 2020 10:06:59 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AB69C20809 for ; Mon, 13 Jul 2020 10:06:59 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="c4dXY9VV"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="pKXWE6r9" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729712AbgGMKG6 (ORCPT ); Mon, 13 Jul 2020 06:06:58 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:37664 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729408AbgGMKGd (ORCPT ); Mon, 13 Jul 2020 06:06:33 -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 06DA35kY026888; Mon, 13 Jul 2020 03:06:17 -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=WuwGkilP8meNxX/PwAO2woJ8oPynNV3zJrfeWhpzYeM=; b=c4dXY9VVqWnoTIUOVtMKMBvBppSZKN4eUMjJp+xI5IxjFGMfPniYDRN7QSNQtssOzIiV NDd8EUqI6NG8Nod7aDdkzoqkaGXp+kc4Nq6DJjuL15K7942tqEAuv3ga38xThgS/ZzBs ZQxcU3cCtynbN1lEVrtEqCXTxTfJ89WuvdctHVkJIqgiSOSTaXBodYxTAonD/zvXbJc6 Qgz0+kKtR9Yfb6fSR/NRMXUQdRwrvJZOTbUT0hnnX2tpMqrLQTDY1VI7dkvhVa+Xoyr1 wx41elHFEaXPXgyv6JRck1mXxF4xcpuyfFCxzanBm5RtlOwmES+Lr2ux9XtseT3rkNvG Hw== Received: from nam12-dm6-obe.outbound.protection.outlook.com (mail-dm6nam12lp2173.outbound.protection.outlook.com [104.47.59.173]) by mx0a-0014ca01.pphosted.com with ESMTP id 3279yud6cp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:17 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Qhd5mPaZqI8aPjg/eVOy69wfUuWX5skBmyn/Fybj0ck2vnMujRAUdnEqlsxTQK/+c8MBktU1Rdwdip8y8/cZLrTq89EjJlNuqfTf+OZY48+R6o5W50OJCRcGzyhtZhbfPdbqxX2MdpoHNOHBVvEBp1LaBSDckqop6iOMvMxR7EairTIedStG849u9S5L6VvAR3GsK3ee9GPs/iP+pdpDreogW3pSkagqrqU52OuTpTkAIsgiTWSYsvlNK4J1mIEmXhmkDfUm1zQCqNzQUEVSIW8QIRP+rdqPi0T73LmvXIassSyW3O9MwbRNJQkqwhP/ilv9o676Wh6wdTkGpwYBdg== 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=WuwGkilP8meNxX/PwAO2woJ8oPynNV3zJrfeWhpzYeM=; b=GXMBwyiJbFs4qpg/wzsvoNWqPJXIp+ev0F3E/7hNnMW1ejfzPF2d6MPlW8V7x3BkBhEbkc33C6yLOeJBsoezf+6MhvKO0T/zJ8TDkEaWcQr2phYezsbi4cqvqkTr8abhz6aJwDOd175XW+c/tJIHN8TydUbYvMdYjaXiQv/LKZJzX9B47LVGp7az384ZPzAuKYM7n/ECn2w/xyGUvQ8jlzdLZ54wz2PE8TE9l22QQbYy4n32VC+QV4SIqBNrw2vZoVXjNSmxiUS/pXsuDWnhd2xWhQCcPtIimdYONtFzUGH4hDshCFNC4KvAvD1DViDxY0iAAwQF4X3DtpKmPQ6ptA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=WuwGkilP8meNxX/PwAO2woJ8oPynNV3zJrfeWhpzYeM=; b=pKXWE6r9EeZc18tMG53lePWORb/mq//WQNa3Vc9NFCOLDfGpoBwWguLOU6r38C/hklI1Eja0H3JBz/AftEnUxi4JlgX5PpHIgAv/Q4zaSjBW2gCQnq6q5beFrnp0onNHLS7s/LvBKuJljEsZQxx3kzcxlu1ItLhnh1bT9vDSJCg= Received: from DM5PR20CA0002.namprd20.prod.outlook.com (2603:10b6:3:93::12) by SN4PR0701MB3647.namprd07.prod.outlook.com (2603:10b6:803:44::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.22; Mon, 13 Jul 2020 10:06:15 +0000 Received: from DM6NAM12FT016.eop-nam12.prod.protection.outlook.com (2603:10b6:3:93:cafe::a4) by DM5PR20CA0002.outlook.office365.com (2603:10b6:3:93::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Mon, 13 Jul 2020 10:06:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) by DM6NAM12FT016.mail.protection.outlook.com (10.13.178.217) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:14 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Yw013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:13 -0400 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; Mon, 13 Jul 2020 12:06:04 +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; Mon, 13 Jul 2020 12:06:04 +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 06DA64MJ028657; Mon, 13 Jul 2020 12:06:04 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA64M4028656; Mon, 13 Jul 2020 12:06:04 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 8/9] usb: cdns3: core: removed overwriting some error code Date: Mon, 13 Jul 2020 12:05:53 +0200 Message-ID: <20200713100554.28530-9-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(346002)(39860400002)(376002)(136003)(396003)(36092001)(46966005)(86362001)(8676002)(8936002)(107886003)(1076003)(36756003)(5660300002)(70206006)(426003)(42186006)(36906005)(2616005)(316002)(7416002)(2906002)(6666004)(82310400002)(82740400003)(47076004)(110136005)(26005)(54906003)(70586007)(478600001)(356005)(336012)(186003)(81166007)(4326008)(83380400001);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 8402f618-c86d-411c-1b47-08d8271460c3 X-MS-TrafficTypeDiagnostic: SN4PR0701MB3647: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:421; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: BrS3l6B8rDXt/PptkKrNMenXzQDNolzwEvhrIWCfDyyqCigorJ1M8uuenKkA6kfUwJt19vCbxkfdHcdSF5Un8NTNRJtKZ2Lnau5cUTPFGQRae6UHocijTntr0p2LhsE6saFFyAMdupKgtK5BjVY7iXFKPuDT/3fKCysAAKC5GkwljlKnplQ61AbdzegoirQ0+5a0/6eFaSU9fKjlEvirZr8LIfOI9WKJmtazkT7erIY5cqFmzUp2qhh+dIWi3GghXoOC3XqzmjVKF1iduKOumYgyElcqeACmy3Cn9f+ScaS2yvvp3KO0jlvqWAhUEGW9mXHUtN+v3N05g8cpl7aRrC3DuxFIb5FT+VqfYcKtUfweYO0sVLTxWMS6uwj9liHYG2X6JuGTbZW9kdGAGebnpBQQGnrig2QWdqQZ2xonzmg= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:14.8483 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8402f618-c86d-411c-1b47-08d8271460c3 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: DM6NAM12FT016.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR0701MB3647 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-13,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=999 mlxscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 8e3996f211a8..72885c5edb09 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 Mon Jul 13 10:05:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pawel Laszczak X-Patchwork-Id: 11659289 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 CBEAE14DD for ; Mon, 13 Jul 2020 10:07:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A948420758 for ; Mon, 13 Jul 2020 10:07:38 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=cadence.com header.i=@cadence.com header.b="HIiBhxAb"; dkim=pass (1024-bit key) header.d=cadence.com header.i=@cadence.com header.b="SvywCx9a" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729745AbgGMKHf (ORCPT ); Mon, 13 Jul 2020 06:07:35 -0400 Received: from mx0a-0014ca01.pphosted.com ([208.84.65.235]:2158 "EHLO mx0a-0014ca01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726523AbgGMKHf (ORCPT ); Mon, 13 Jul 2020 06:07:35 -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 06DA35kZ026888; Mon, 13 Jul 2020 03:06:18 -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=/QkRZ+7XFtiDlo2uTG2+8Q8lBDudq4qciqIVSHspkGs=; b=HIiBhxAb9ssFfCn/AyrwRInNerTZQew/Vn+y70Uwvs+yWD4iEoX5bBb9bIksN+ZnPeoc 7Gb+MTRQVEbF44Jm5148YYTReTDXi+wZOATHyRqo+xWGRhnkz8fjh9oFLWFAX/MIsACp zCn9ei4iLCGINDmOPZfNxXX67vRBXThS1206jgukYc3CDW99HGeFGK9HBotFM/W9daZx f1AIEXbfGnQ4Bdz/9nzvbzdB1HG2bDpzj8vpfpLbK/dRMxVsMMwaaOdHR4Y/XCO0bQTi ptGweRpTGTTNmivdAD39lD444tNXkG+M+G3RbQKFQghIVQRNMXfit1dAeIh8AkNXVMvD rw== Received: from nam10-mw2-obe.outbound.protection.outlook.com (mail-mw2nam10lp2103.outbound.protection.outlook.com [104.47.55.103]) by mx0a-0014ca01.pphosted.com with ESMTP id 3279yud6cv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 13 Jul 2020 03:06:18 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=O/uMIQyioIXlGdR6O0jRlU0lV2H5XpxD/MhDIeiICZ/jN31m4GqlXNWHrxZ0xBg98TucGQXC1JPqKOtEku5WpV/hTYBfRSaYslIjglCKvSdfK8pBhEsVDRWtjLvE02khFoGTkoibfo+QQNLtwVsc/ruUzFUTMi+oWgKKhYN0LkdVZZumwnSkqiEJOJ0wehcKUUzH17KjWsRPs/a9KQ9TESmlE96I0tPpYqRTMob3hMB+tyCDwGe2VIGsc7ZgDPvTXJC/g6YQQCTd8r2ATGLbJ6BH8FTgGRtx7JbYLeVaJVuULcEyaRKbfWBRZLdNt1CW2YqzuLqO4rJ/ALK87P6O8g== 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=/QkRZ+7XFtiDlo2uTG2+8Q8lBDudq4qciqIVSHspkGs=; b=fzecAnM3PeK4yQQzHHTnfRR9oQvMElTbQredrt4OEqhiUbKh8pitAe/uDSr1Dv9F7jz328LaM968huY4OCyK1E3cNOsxh9NZvWu+4gpt1VYVH8WYuO3H771CXKptf9R5h0uYBbkNGpCWfzZhuDX6JPcq8R+bTdqM2xrGZBq/tueyW6c8hRc2XYN5G/xa+Th1+74xPTx09STGx9z9iJ17EsqvyJc8HtpmtNqYoMy2z++w3fip1/l95hj0o7K+bpjy7O4WypgSRIiR9j7ItYMP3bwzmMeIs6W41yEqQMBMVh3xTNuHZr51itgjqB6arEpha060oUNNdZuO6ys5jLo3mQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 199.43.4.23) 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=/QkRZ+7XFtiDlo2uTG2+8Q8lBDudq4qciqIVSHspkGs=; b=SvywCx9axVhFuu+YzWmh4gT5TgXIKMXAaYMmyawntufxlCvSMkT3d6wS6Wd1wc/Y60SsotA/6rh94qx4994jR5POcVfPcouy4/7XdE73BqtlHJXdJUYAAcz3z70xiyu81W/1hwUAzuF3HJ6vuCke/3Z9OsDiNvo9Dw1VElgeh9k= Received: from BN6PR08CA0075.namprd08.prod.outlook.com (2603:10b6:404:b6::13) by BY5PR07MB7061.namprd07.prod.outlook.com (2603:10b6:a03:1ee::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.20; Mon, 13 Jul 2020 10:06:16 +0000 Received: from BN8NAM12FT023.eop-nam12.prod.protection.outlook.com (2603:10b6:404:b6:cafe::a3) by BN6PR08CA0075.outlook.office365.com (2603:10b6:404:b6::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3174.21 via Frontend Transport; Mon, 13 Jul 2020 10:06:16 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 199.43.4.23) 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 199.43.4.23 as permitted sender) receiver=protection.outlook.com; client-ip=199.43.4.23; helo=rmmaillnx1.cadence.com; Received: from rmmaillnx1.cadence.com (199.43.4.23) by BN8NAM12FT023.mail.protection.outlook.com (10.13.183.93) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3195.9 via Frontend Transport; Mon, 13 Jul 2020 10:06:15 +0000 Received: from maileu3.global.cadence.com (maileu3.cadence.com [10.160.88.99]) by rmmaillnx1.cadence.com (8.14.4/8.14.4) with ESMTP id 06DA63Yx013926 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Mon, 13 Jul 2020 06:06:14 -0400 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; Mon, 13 Jul 2020 12:06:04 +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; Mon, 13 Jul 2020 12:06:04 +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 06DA64nF028663; Mon, 13 Jul 2020 12:06:04 +0200 Received: (from pawell@localhost) by vleu-orange.cadence.com (8.14.4/8.14.4/Submit) id 06DA64W9028660; Mon, 13 Jul 2020 12:06:04 +0200 From: Pawel Laszczak To: , , , , , CC: , , , , , , , Pawel Laszczak Subject: [PATCH v2 9/9] usb: cdns3: drd: simplify *switch_gadet and *switch_host Date: Mon, 13 Jul 2020 12:05:54 +0200 Message-ID: <20200713100554.28530-10-pawell@cadence.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20200713100554.28530-1-pawell@cadence.com> References: <20200713100554.28530-1-pawell@cadence.com> MIME-Version: 1.0 X-OrganizationHeadersPreserved: maileu3.global.cadence.com X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:199.43.4.23;CTRY:US;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:rmmaillnx1.cadence.com;PTR:InfoDomainNonexistent;CAT:NONE;SFTY:;SFS:(4636009)(396003)(376002)(346002)(136003)(39860400002)(36092001)(46966005)(70586007)(6666004)(86362001)(47076004)(8936002)(7416002)(2616005)(1076003)(426003)(42186006)(82310400002)(356005)(54906003)(83380400001)(4326008)(110136005)(316002)(2906002)(336012)(5660300002)(107886003)(36906005)(8676002)(81166007)(70206006)(26005)(36756003)(82740400003)(186003)(478600001);DIR:OUT;SFP:1101; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ffca3a88-6c4c-4c41-7dbb-08d827146157 X-MS-TrafficTypeDiagnostic: BY5PR07MB7061: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:949; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: qcs20q17fdbOxYkHGQmsmeIU7HIKGS7PRfJTOHhBuhR8+3hTVYww+iv/wm+OWXBRc9jtmuhHNuTWj0ArHBq3hvbFSoGtc5ZE+EQPT2j6cTNU6OJ7zSxKMAT9rDBrTGiE6BTa9ZR7ssrF81tY4iWlaH3+tmozuXzYH3MxqqS5+CuSi/cx86vrt7ROUJLUr1df0MJH09YMqQe8uSZU9VAbZFpR0VZ4wovW3Wl6COdv1imJxregZzwHlo9QWRmOHGB9EpHQIK1LLS0IXBC7reMJRl7HwzeJIa7mLOl0iOlFFfZGjCwMdeUTkrD2k/iNHP5qitCK3i+JdIQ6TFCXGobCUtDj2cwnPnG9Hh0R+6CrGsEGxc24/cJ+wzjpN1AMUkV8LscQIHhESJjPnR0fHh0rESm6ei/xHMYpclkHTAQybS0= X-OriginatorOrg: cadence.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2020 10:06:15.8598 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ffca3a88-6c4c-4c41-7dbb-08d827146157 X-MS-Exchange-CrossTenant-Id: d36035c5-6ce6-4662-a3dc-e762e61ae4c9 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=d36035c5-6ce6-4662-a3dc-e762e61ae4c9;Ip=[199.43.4.23];Helo=[rmmaillnx1.cadence.com] X-MS-Exchange-CrossTenant-AuthSource: BN8NAM12FT023.eop-nam12.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BY5PR07MB7061 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235,18.0.687 definitions=2020-07-13_07:2020-07-13,2020-07-13 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_check_notspam policy=outbound_check score=0 lowpriorityscore=0 spamscore=0 priorityscore=1501 adultscore=0 malwarescore=0 suspectscore=0 clxscore=1015 bulkscore=0 mlxlogscore=990 mlxscore=0 phishscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2006250000 definitions=main-2007130075 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 d9dde624636b..bf1a7ac1cbfc 100644 --- a/drivers/usb/cdns3/gadget.c +++ b/drivers/usb/cdns3/gadget.c @@ -3015,7 +3015,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) @@ -3146,7 +3146,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)