Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp2910354pxb; Tue, 24 Aug 2021 10:23:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwIsxFnz0kVTxitEKi25JYZcMPR8YxbX4868iyJ/GDfi4N7hKP/wh7hwBj39Cnb+HjJvgb2 X-Received: by 2002:a17:906:b745:: with SMTP id fx5mr20704652ejb.515.1629825823285; Tue, 24 Aug 2021 10:23:43 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1629825823; cv=pass; d=google.com; s=arc-20160816; b=nu2uAY0wNyu+Oq4m8Qmul2rdyc0P/owWyVk/fmbS7JyNA03px0qkzwY6DdZ5E8LKbl 5fT7nhsDf0L7D/nO+kmuwVBDSyxGacG02B0yGeAzXG/o5+gVMAvfs9JiaGqz633uzpI+ Ho4+fQ88b7zfCBaxgmfvG2xSZU0haZHNKDAAZof8vMr6EUHn4UQ2MMkshbDKBeFTjIdm 7x8AMAkt7xszv44mscFhUCMDMRc9JH7OYMmTl2Dqt9q8HEM7F6WmU1Oq6PS3jgJE7oyl tnus7GsHG72ongOt+jGdnpXprImmQ0HrqwbVeU9PgnAaUwpIEtal3/SiVRK4Rv8my/xp r3vg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:in-reply-to:message-id :date:subject:cc:to:from:envelope-to:dkim-signature; bh=Rfy02Cl0w6CyGciC8JFZa/SZn8yCtQL2V7ejDpTdZJY=; b=nvz7soctIntuKZDlXamJcGOi2gY/BQjo3W+TVwGbVux1kpluos/EQTMZqAylgKYJTe de0Mmal16gOq5QxZE63Fbc+KEzXMs7PtUoT0ee1feg/2QA/e71HcFzWrm6uYfzadNn5T bQ8ZCqCdnZglRMS84ES+rAVQ+iX4Kqd1PPY0CkI+fOSKgNzix74r4XBDyI9t+56nAWz9 ybcVC4h8LMqApyKD/LwdCSRW/runiVCKMRJkf7J2seQgWBCn9Q+BYaipnoJQpUNVM1fW FZRSOHS9MY7Luas/BgY7ZT1mWH0L4sFrW5+84l/NmGobSfZ6HKt1whIT+FTjTsISwiyL XKTg== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=FA1a4nBB; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ec46si17231130edb.609.2021.08.24.10.23.10; Tue, 24 Aug 2021 10:23:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@xilinx.onmicrosoft.com header.s=selector2-xilinx-onmicrosoft-com header.b=FA1a4nBB; arc=pass (i=1 spf=pass spfdomain=xilinx.com dmarc=pass fromdomain=xilinx.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xilinx.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240103AbhHXRUm (ORCPT + 99 others); Tue, 24 Aug 2021 13:20:42 -0400 Received: from mail-mw2nam12on2083.outbound.protection.outlook.com ([40.107.244.83]:30176 "EHLO NAM12-MW2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S239880AbhHXRSM (ORCPT ); Tue, 24 Aug 2021 13:18:12 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=QkeB6050ooqj1u9uZY+WNufiYpduWH2GpXJm01kcbYm9ErkWHYayBy1uqL3oE2Roq5EgB1GTo2612qJrptQXSt6nN/bpgrQw41Dn80TVjOv1mWiWOuFVOk4gjygsj0mVa3il+5jIumddQF2XZF8vWT/oDCBbNYYnVUqJ42hyuFBDyTSxV7VEepgWE3E0CckYHJIkgrPBdUb9MY1ss1o8InAgkLjswbpFKkGREtWpjAF7TgdFjoRrZEvjTbg13OODmHj13EAMzYV4mGuCT33+f5YhvigcaNhbUq5NQP7TFZellq9j83L2JDWTIVKcPN17puAP9mdkocA6ezGlw2kw0A== 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=Rfy02Cl0w6CyGciC8JFZa/SZn8yCtQL2V7ejDpTdZJY=; b=EgVldQXgz0+IHI8Ttv7Wj0xD3S8uQeCUwmuV6Lh4UMMY8yNA7dpNlF94gN13yg7HGWt538ML0Iqmc/ngV741pUxYm0ZsMzcsfc/SbFivltrfZje1am28raCIt26Oui2RO9UjpUcdFzLHTgcTZBlEgKTGYhezaDUc2zzaVlu0lpeXqrjqJxPlvAWYx4ZMEvvOOKXgksY0BPmbkbH5BtdtD3KXMDHUv7fG4YTW1K6Eu23GDSI1YjjCN2X0EIaaysBTiXvrTK+ZxDbDZ7hiA9hGdRpo1WpdN5ACo0u3Wj3qNwF5uM5drAIYOYAKkzpA1ndSuTeYRXd3ZALxuB3mrRHhCw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 149.199.62.198) smtp.rcpttodomain=kernel.org smtp.mailfrom=xilinx.com; dmarc=pass (p=none sp=none pct=100) action=none header.from=xilinx.com; dkim=none (message not signed); arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector2-xilinx-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Rfy02Cl0w6CyGciC8JFZa/SZn8yCtQL2V7ejDpTdZJY=; b=FA1a4nBB8yCB9rVFzQFwJhe7uIMd6Q5BYn+sIZ9QqTYlXMIDRWWCVFmq3jEu1XXtlJwbOW0ALFhT1lbW63CF5rYlY/tTuS1jBE82bgOmYZNpDkWfLyFWgsufgAOTfrtCdl8swtpGFNOoUgTNSgdHTdMSCUNtZpek4yAyV2kK83M= Received: from DM5PR10CA0005.namprd10.prod.outlook.com (2603:10b6:4:2::15) by DM5PR0201MB3574.namprd02.prod.outlook.com (2603:10b6:4:77::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.22; Tue, 24 Aug 2021 17:17:22 +0000 Received: from DM3NAM02FT004.eop-nam02.prod.protection.outlook.com (2603:10b6:4:2:cafe::55) by DM5PR10CA0005.outlook.office365.com (2603:10b6:4:2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 17:17:22 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 149.199.62.198) smtp.mailfrom=xilinx.com; kernel.org; dkim=none (message not signed) header.d=none;kernel.org; dmarc=pass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.62.198 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.62.198; helo=xsj-pvapexch01.xlnx.xilinx.com; Received: from xsj-pvapexch01.xlnx.xilinx.com (149.199.62.198) by DM3NAM02FT004.mail.protection.outlook.com (10.13.5.122) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.20.4436.19 via Frontend Transport; Tue, 24 Aug 2021 17:17:22 +0000 Received: from xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) by xsj-pvapexch01.xlnx.xilinx.com (172.19.86.40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2176.14; Tue, 24 Aug 2021 10:17:06 -0700 Received: from smtp.xilinx.com (172.19.127.96) by xsj-pvapexch02.xlnx.xilinx.com (172.19.86.41) with Microsoft SMTP Server id 15.1.2176.14 via Frontend Transport; Tue, 24 Aug 2021 10:17:06 -0700 Envelope-to: git@xilinx.com, peter.chen@kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org Received: from [172.23.64.8] (port=48481 helo=xhdvnc108.xilinx.com) by smtp.xilinx.com with esmtp (Exim 4.90) (envelope-from ) id 1mIa2r-000EeV-AW; Tue, 24 Aug 2021 10:17:05 -0700 Received: by xhdvnc108.xilinx.com (Postfix, from userid 16987) id 86B15604B4; Tue, 24 Aug 2021 22:46:34 +0530 (IST) From: Manish Narani To: , , CC: , , , Manish Narani , "Subbaraya Sundeep Bhatta" Subject: [PATCH 3/6] usb: chipidea: Check usb_phy exists before using it Date: Tue, 24 Aug 2021 22:46:15 +0530 Message-ID: <1629825378-8089-4-git-send-email-manish.narani@xilinx.com> X-Mailer: git-send-email 2.1.1 In-Reply-To: <1629825378-8089-1-git-send-email-manish.narani@xilinx.com> References: <1629825378-8089-1-git-send-email-manish.narani@xilinx.com> MIME-Version: 1.0 Content-Type: text/plain X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 34c6cca0-420c-4014-0672-08d9672308f3 X-MS-TrafficTypeDiagnostic: DM5PR0201MB3574: X-Microsoft-Antispam-PRVS: X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: F/+6uY76FbmbK59fZJYfS0wAeuPLILf7lL6pOtO/2gdBS7RApuxHcEemCcDCIUbSJauDxfOQOlkp1HonanbCvkbt6XIZQmTL11IslrgphDxkJ+JOwo9TFp9P707I41IVtRQ7+tlDU1/H5w/Rp536552f6Hmk30YTgUMq0OZVUi6gP6Pm4JUIBYonDan6aPgIQDAqgStF378kte0NUU4Rh6xmU7ZkLldWqyPmbETg+Kti473olzYpyspc2EAEPZzaXfaqbSQVu1LxHzBWViMYxyO6tMPgOnnL0RatLTnfKAkWneKMU6WWXisVQlYCa16MB/pH/7m7yqs4M/4H+zwXOT+hk7lPtdUC+ciogYf35L7zrZNsyo3kaAlqSDkuJXMMw+NXhapFOHZoRpNlm2NSD3wrZLrkwDHMRXlZHZX731HwZq/IYeKzB2yHSNeMLXBWfNgADrhKV+H3vCWZycqYgPjEcpHirl2zFVbrYAtUnyccAxIUdC0Glwt6zlqgdezFY7gPxILnUjk23Z9pLDFidZyYkXL0mZLjOnjbNEAZ+SLXqcIDAIcItnmN2xCnChr4fyBMrM2VnYup++XSPvbua5DCf9eq2nVXELHlSrlFIzPtiT+0eASR0JU+HmnB6Lqpt4b9pc6HSj9RoXRrCJ+TBS+lcxBhsIwJvmr7F7aeC2w0AVhehPkMoGFWACf/yIHyk11KdetzJuZCCScUxVldBIcRVIsJgLyGidiJB28yN1s= X-Forefront-Antispam-Report: CIP:149.199.62.198;CTRY:US;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:xsj-pvapexch01.xlnx.xilinx.com;PTR:unknown-62-198.xilinx.com;CAT:NONE;SFS:(4636009)(136003)(396003)(376002)(39860400002)(346002)(46966006)(36840700001)(70586007)(110136005)(6636002)(70206006)(4326008)(54906003)(316002)(82740400003)(7636003)(478600001)(356005)(5660300002)(47076005)(36906005)(8936002)(26005)(42186006)(36756003)(107886003)(44832011)(36860700001)(83380400001)(2616005)(336012)(426003)(6666004)(82310400003)(6266002)(186003)(2906002)(8676002)(102446001);DIR:OUT;SFP:1101; X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Aug 2021 17:17:22.0387 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 34c6cca0-420c-4014-0672-08d9672308f3 X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.62.198];Helo=[xsj-pvapexch01.xlnx.xilinx.com] X-MS-Exchange-CrossTenant-AuthSource: DM3NAM02FT004.eop-nam02.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR0201MB3574 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org usb_phy and usb_phy->set_vbus may not be present all the times based on PHY driver used. So check for it. Signed-off-by: Subbaraya Sundeep Bhatta Signed-off-by: Michal Simek Signed-off-by: Manish Narani --- drivers/usb/chipidea/otg_fsm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/usb/chipidea/otg_fsm.c b/drivers/usb/chipidea/otg_fsm.c index 2f7f94d..5f8f5d2 100644 --- a/drivers/usb/chipidea/otg_fsm.c +++ b/drivers/usb/chipidea/otg_fsm.c @@ -472,7 +472,8 @@ static void ci_otg_drv_vbus(struct otg_fsm *fsm, int on) } } - if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL) + if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL && + ci->usb_phy && ci->usb_phy->set_vbus) ci->usb_phy->set_vbus(ci->usb_phy, 1); /* Disable data pulse irq */ @@ -484,7 +485,8 @@ static void ci_otg_drv_vbus(struct otg_fsm *fsm, int on) if (ci->platdata->reg_vbus) regulator_disable(ci->platdata->reg_vbus); - if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL) + if (ci->platdata->flags & CI_HDRC_PHY_VBUS_CONTROL && + ci->usb_phy && ci->usb_phy->set_vbus) ci->usb_phy->set_vbus(ci->usb_phy, 0); fsm->a_bus_drop = 1; -- 2.1.1