From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S965510AbbHKP5v (ORCPT ); Tue, 11 Aug 2015 11:57:51 -0400 Received: from devils.ext.ti.com ([198.47.26.153]:37637 "EHLO devils.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S965492AbbHKP5q (ORCPT ); Tue, 11 Aug 2015 11:57:46 -0400 From: Kishon Vijay Abraham I To: CC: , Subject: [PATCH 16/19] phy-sun4i-usb: Only check vbus-det on power-on on boards with vbus-det Date: Tue, 11 Aug 2015 21:27:15 +0530 Message-ID: <1439308638-14582-17-git-send-email-kishon@ti.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1439308638-14582-1-git-send-email-kishon@ti.com> References: <1439308638-14582-1-git-send-email-kishon@ti.com> MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Hans de Goede data->vbus_det is always 1 on boards without a (working) vbus-det, skip the vbus_det test on such boards. This fixes the sun4i usb phy code never turning on Vbus on such boards. Signed-off-by: Hans de Goede Signed-off-by: Kishon Vijay Abraham I --- drivers/phy/phy-sun4i-usb.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/phy/phy-sun4i-usb.c b/drivers/phy/phy-sun4i-usb.c index 27ae89e..e2eb688d 100644 --- a/drivers/phy/phy-sun4i-usb.c +++ b/drivers/phy/phy-sun4i-usb.c @@ -328,7 +328,8 @@ static int sun4i_usb_phy_power_on(struct phy *_phy) return 0; /* For phy0 only turn on Vbus if we don't have an ext. Vbus */ - if (phy->index == 0 && data->vbus_det) + if (phy->index == 0 && sun4i_usb_phy0_have_vbus_det(data) && + data->vbus_det) return 0; ret = regulator_enable(phy->vbus); -- 1.7.9.5