From patchwork Thu Mar 13 11:11:13 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Grygorii Strashko X-Patchwork-Id: 3824771 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DDC059F1CD for ; Thu, 13 Mar 2014 10:33:53 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 189B7201FB for ; Thu, 13 Mar 2014 10:33:53 +0000 (UTC) Received: from casper.infradead.org (casper.infradead.org [85.118.1.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id EA4DD201E9 for ; Thu, 13 Mar 2014 10:33:51 +0000 (UTC) Received: from merlin.infradead.org ([2001:4978:20e::2]) by casper.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WO2jD-0004LZ-1D; Thu, 13 Mar 2014 10:19:08 +0000 Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1WO2ii-0003BQ-0H; Thu, 13 Mar 2014 10:18:36 +0000 Received: from devils.ext.ti.com ([198.47.26.153]) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1WO2if-00038H-Cv for linux-arm-kernel@lists.infradead.org; Thu, 13 Mar 2014 10:18:34 +0000 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by devils.ext.ti.com (8.13.7/8.13.7) with ESMTP id s2DAIAUS010083; Thu, 13 Mar 2014 05:18:10 -0500 Received: from DLEE70.ent.ti.com (dlee70.ent.ti.com [157.170.170.113]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2DAIAO3002178; Thu, 13 Mar 2014 05:18:10 -0500 Received: from dlep32.itg.ti.com (157.170.170.100) by DLEE70.ent.ti.com (157.170.170.113) with Microsoft SMTP Server id 14.3.174.1; Thu, 13 Mar 2014 05:18:10 -0500 Received: from localhost (dlep60.itg.ti.com [157.170.170.21]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id s2DAI9Pt008987; Thu, 13 Mar 2014 05:18:09 -0500 From: Grygorii Strashko To: Kishon Vijay Abraham I Subject: [PATCH][next] phy: core: make NULL a valid phy reference if !CONFIG_GENERIC_PHY Date: Thu, 13 Mar 2014 13:11:13 +0200 Message-ID: <1394709073-1980-1-git-send-email-grygorii.strashko@ti.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140313_061833_528060_43B45003 X-CRM114-Status: UNSURE ( 8.99 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -6.9 (------) Cc: Grygorii Strashko , linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, Felipe Balbi , Santosh Shilimkar , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This fixes a regression on Keystone 2 platforms caused by patch 57303488cd37da58263e842de134dc65f7c626d5 "usb: dwc3: adapt dwc3 core to use Generic PHY Framework" which adds optional support of generic phy in DWC3 core. On Keystone 2 platforms the USB is not working now because CONFIG_GENERIC_PHY isn't set and, as result, Generic PHY APIs stubs return -ENOSYS always. The log shows: dwc3 2690000.dwc3: failed to initialize core dwc3: probe of 2690000.dwc3 failed with error -38 Hence, fix it by making NULL a valid phy reference in Generic PHY APIs stubs in the same way as it was done by the patch 04c2facad8fee66c981a51852806d8923336f362 "drivers: phy: Make NULL a valid phy reference". CC: Kishon Vijay Abraham I CC: Felipe Balbi CC: Santosh Shilimkar Signed-off-by: Grygorii Strashko Acked-by: Santosh Shilimkar Acked-by: Felipe Balbi --- include/linux/phy/phy.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/linux/phy/phy.h b/include/linux/phy/phy.h index e2f5ca9..5a9b193 100644 --- a/include/linux/phy/phy.h +++ b/include/linux/phy/phy.h @@ -204,21 +204,29 @@ static inline void phy_pm_runtime_forbid(struct phy *phy) static inline int phy_init(struct phy *phy) { + if (!phy) + return 0; return -ENOSYS; } static inline int phy_exit(struct phy *phy) { + if (!phy) + return 0; return -ENOSYS; } static inline int phy_power_on(struct phy *phy) { + if (!phy) + return 0; return -ENOSYS; } static inline int phy_power_off(struct phy *phy) { + if (!phy) + return 0; return -ENOSYS; }