From patchwork Thu Apr 25 15:40:20 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 10917387 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C4E0D76 for ; Thu, 25 Apr 2019 15:40:58 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B610628CFE for ; Thu, 25 Apr 2019 15:40:58 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id AA05728D06; Thu, 25 Apr 2019 15:40:58 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 58E0028D05 for ; Thu, 25 Apr 2019 15:40:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=h2WJlxh4YavgpuwE7G7WBMBbQc38YzYym9k6aMowgL0=; b=RH7dDJa7Z6Vc3/ F9CfxXHbxijOfAkaQV46iO7bkS/fwAwPRxvVtwI6U2Ml3vx1Np7uUuCQjw9PBDaQ+VgFz6SWDJG0l Ncx9fpNz7mO475hUAo8uSvVjiKxxb9gL65iLQvzPQltZ1VQuazsJc8SpcC1YuKzcKtL/2UD5GIfjb 04u066Xu/1esWDBqLpgDL5v3Xwx5SrIPJMp3ufPXAQSBLQspWMbuPhUnrYLNOB0oKJHomuy22pNZK a2Hwto1jSLZK090giz4e1KEsq0Q8no5WoanZwHbmuJf084jTj/AVK7tohvsEjuilWv8EpciNugVy2 Dl3UhrLK0jKl8vhV2MMw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJgUZ-0001kX-7K; Thu, 25 Apr 2019 15:40:55 +0000 Received: from mail-pg1-x541.google.com ([2607:f8b0:4864:20::541]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hJgUR-0001ZG-G5 for linux-rockchip@lists.infradead.org; Thu, 25 Apr 2019 15:40:50 +0000 Received: by mail-pg1-x541.google.com with SMTP id z16so26699pgv.11 for ; Thu, 25 Apr 2019 08:40:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c9Y7B+CeLYhx3Q0s+6+K+1WBb1zBEwhZDiIr8GtHvto=; b=AXvyrbrZwlrD48HT5WD5NUZnt5xXqnZnQNBABQU/t2W7a8lP9YG+5m1l8w+KytSbCw /H6lMMo4es7fbOmLfiDyZNiIEtNy4Nbl+L1EAV+CbsuBkSTA42g42GlEUwCcQahQpgss /ItIvK9ypHOoO7hJRk7fjTq5LZndyQVZT0/W4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=c9Y7B+CeLYhx3Q0s+6+K+1WBb1zBEwhZDiIr8GtHvto=; b=e8aXiZhDwBbTtpvV+uzBOkP0JTDbrpNhIRgrYoGl2NmJ+2s04Zha3zD9dVY1Vvxi8R 1QlcDbYeh5To7X1aUWBEWtRe50BbWx850/eC4OIsBgwoQXtx002oBq1U3kyt6Isu9Qdf xCI8FLkUhOFHpvioabYA1g4zKy086NClckdhG32sxm6dAy/k2jd+PX7PDUgUpMO5iAbx mSMMgQrtwYjzjSQrVgW3A/txjpVIcfNDDGk+KzSsvvKLs5tsW3irCM4hX0Bz47PEEZ1q LyyUiEJIHL00Rjn1RhEHpWmLnYx+1snC2uKVVriVq/Kl4ewAYJolS6pw7Q4f2CcQdjj9 pdlA== X-Gm-Message-State: APjAAAVcpE8uh/lXacSVb2L+hsSUHZ0S9iBHQloOUuAdoNYpHYbWcK92 yuPN8Uo++48Co94PbC0+UHlYpA== X-Google-Smtp-Source: APXvYqzQnDnl7mNs9HRmGlyygBTArTSR9rk+i9bJ8k6dviK9WGY2nAvBBtYp0aXc7qqkLpzqfvbg1A== X-Received: by 2002:aa7:9116:: with SMTP id 22mr33822675pfh.165.1556206846715; Thu, 25 Apr 2019 08:40:46 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:202:1:24fa:e766:52c9:e3b2]) by smtp.gmail.com with ESMTPSA id j9sm49948689pfc.43.2019.04.25.08.40.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Apr 2019 08:40:46 -0700 (PDT) From: Douglas Anderson To: Minas Harutyunyan , Felipe Balbi Subject: [PATCH] usb: dwc2: Fix phy_reset_work compile error for peripheral-only config Date: Thu, 25 Apr 2019 08:40:20 -0700 Message-Id: <20190425154021.4465-1-dianders@chromium.org> X-Mailer: git-send-email 2.21.0.593.g511ec345e18-goog MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190425_084047_807765_256F77FB X-CRM114-Status: GOOD ( 12.66 ) X-BeenThere: linux-rockchip@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Upstream kernel work for Rockchip platforms List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Artur Petrosyan , Randy Li , amstan@chromium.org, Greg Kroah-Hartman , linux-usb@vger.kernel.org, Douglas Anderson , linux-kernel@vger.kernel.org, linux-rockchip@lists.infradead.org, mka@chromium.org, ryandcase@chromium.org, Elaine Zhang , kbuild test robot , jwerner@chromium.org, Heiko Stuebner Sender: "Linux-rockchip" Errors-To: linux-rockchip-bounces+patchwork-linux-rockchip=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP In commit a0a493835f9a ("usb: dwc2: optionally assert phy reset when waking up") I added to code that is compiled in both the host and peripheral configs but it referenced a structure member that I added to a section that was only there for host or dual-mode configs. That led to the compile error: >> drivers/usb/dwc2/core_intr.c:448:25: error: 'struct dwc2_hsotg' has no member named 'phy_reset_work' We'll add a little helper function to schedule the work and then we can have a dummy version of that helper in peripheral-only mode. Fixes: a0a493835f9a ("usb: dwc2: optionally assert phy reset when waking up") Reported-by: kbuild test robot Signed-off-by: Douglas Anderson --- drivers/usb/dwc2/core.h | 3 +++ drivers/usb/dwc2/core_intr.c | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/usb/dwc2/core.h b/drivers/usb/dwc2/core.h index 6698c7097499..152ac41dfb2d 100644 --- a/drivers/usb/dwc2/core.h +++ b/drivers/usb/dwc2/core.h @@ -1438,6 +1438,8 @@ int dwc2_restore_host_registers(struct dwc2_hsotg *hsotg); int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg); int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, int reset); +static inline void dwc2_host_schedule_phy_reset(struct dwc2_hsotg *hsotg) +{ schedule_work(&hsotg->phy_reset_work); } #else static inline int dwc2_hcd_get_frame_number(struct dwc2_hsotg *hsotg) { return 0; } @@ -1461,6 +1463,7 @@ static inline int dwc2_host_enter_hibernation(struct dwc2_hsotg *hsotg) static inline int dwc2_host_exit_hibernation(struct dwc2_hsotg *hsotg, int rem_wakeup, int reset) { return 0; } +static inline void dwc2_host_schedule_phy_reset(struct dwc2_hsotg *hsotg) {} #endif diff --git a/drivers/usb/dwc2/core_intr.c b/drivers/usb/dwc2/core_intr.c index 16ff33574116..6af6add3d4c0 100644 --- a/drivers/usb/dwc2/core_intr.c +++ b/drivers/usb/dwc2/core_intr.c @@ -445,7 +445,7 @@ static void dwc2_handle_wakeup_detected_intr(struct dwc2_hsotg *hsotg) * schedule it for later. */ if (hsotg->reset_phy_on_wake) - schedule_work(&hsotg->phy_reset_work); + dwc2_host_schedule_phy_reset(hsotg); mod_timer(&hsotg->wkp_timer, jiffies + msecs_to_jiffies(71));