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: 10917385 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 11799912 for ; Thu, 25 Apr 2019 15:40:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 03BB528CEF for ; Thu, 25 Apr 2019 15:40:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EB66128D09; Thu, 25 Apr 2019 15:40:48 +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=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 811EB28CEF for ; Thu, 25 Apr 2019 15:40:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726282AbfDYPkr (ORCPT ); Thu, 25 Apr 2019 11:40:47 -0400 Received: from mail-pf1-f195.google.com ([209.85.210.195]:45655 "EHLO mail-pf1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725942AbfDYPkr (ORCPT ); Thu, 25 Apr 2019 11:40:47 -0400 Received: by mail-pf1-f195.google.com with SMTP id e24so86046pfi.12 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=hUaus3ElQHrthDz3FZkfOk7z70XBJ2i+QNIYp8YBdPtaJwa/wVGYlTdTI/b1L1kiMH Ju9Vs6rpZqhVRgjZktIKDWxI5HKb7d9qhmxo8eRcVs5KIbu/tWjLd1f/sQVPvolKhatR we+TQ7r7+ePjnN0h/d8due0nwrynnayXLrN2h4smxgfKtd3YIRy9y1qSf39iTv7Q8BUx WWsc++BF4hM6SshMsTGtoOMWFeRCuIlA36LHfMOv2KCk0SDiWWVMy05kvGoE/RrkY/I3 LmTdLBxraECqqJTfu3uPM4nlWrLdL7s/HWHd3Sj1N8MmJCNkUOlzLzFiHXGZ7WLnlok6 gRgQ== X-Gm-Message-State: APjAAAVp98xJi1xLRC3Af0idBiTbcE9Esbl1k5UgY59LtWP/jno/LXuo ivcZgEceSvMKX9qmYX43EEP4Ig== 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 Cc: Artur Petrosyan , amstan@chromium.org, Heiko Stuebner , linux-rockchip@lists.infradead.org, linux-usb@vger.kernel.org, Randy Li , mka@chromium.org, ryandcase@chromium.org, jwerner@chromium.org, Elaine Zhang , Douglas Anderson , kbuild test robot , Greg Kroah-Hartman , linux-kernel@vger.kernel.org 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 Sender: linux-usb-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.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));