From patchwork Thu Oct 29 17:01:27 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H. Nikolaus Schaller" X-Patchwork-Id: 7520011 Return-Path: X-Original-To: patchwork-linux-pm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 6F15B9F37F for ; Thu, 29 Oct 2015 17:01:45 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A66A22066D for ; Thu, 29 Oct 2015 17:01:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 195B3207EA for ; Thu, 29 Oct 2015 17:01:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757048AbbJ2RBj (ORCPT ); Thu, 29 Oct 2015 13:01:39 -0400 Received: from mo4-p00-ob.smtp.rzone.de ([81.169.146.217]:48036 "EHLO mo4-p00-ob.smtp.rzone.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757056AbbJ2RBi (ORCPT ); Thu, 29 Oct 2015 13:01:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; t=1446138097; l=988; s=domk; d=goldelico.com; h=References:In-Reply-To:References:In-Reply-To:Date:Subject:Cc:To: From; bh=dZSD9HJ5BE/muHCYHXC3B2jDTOZCvTwtSwWBukR2siI=; b=humG87ve88QYYCOom/STPlT4vN/Mm8Vujf6W99DKqlyeBDpXVNWxKzhxV4bhws1LvWJ szO5U+7DhTpgSJMV6nMcQkQfoMAuLd6sutqUloDhuG1bnJABRT87fyzHH/GTEhxtqFQG9 WnOGHaddHOeJ4DJzqKXL0UkngejIbqOco2Q= X-RZG-AUTH: :JGIXVUS7cutRB/49FwqZ7WcecEarQROEYabkiUo6mSAGQ+qKIDsoIyHJuw== X-RZG-CLASS-ID: mo00 Received: from localhost.localdomain (p57AE058A.dip0.t-ipconnect.de [87.174.5.138]) by smtp.strato.de (RZmta 37.14 DYNA|AUTH) with ESMTPA id Z02f7fr9TH1UYEJ; Thu, 29 Oct 2015 18:01:30 +0100 (CET) From: "H. Nikolaus Schaller" To: =?UTF-8?q?Gra=C5=BEvydas=20Ignotas?= , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse Cc: linux-pm@vger.kernel.org, gta04-owner@goldelico.com, "H. Nikolaus Schaller" Subject: [PATCH 1/2] drivers:power:twl4030-charger: fix problem with EPROBE_DEFER Date: Thu, 29 Oct 2015 18:01:27 +0100 Message-Id: X-Mailer: git-send-email 2.5.1 In-Reply-To: References: In-Reply-To: References: Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham 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 devm_usb_get_phy_by_node() may return -EPROBE_DEFER in which case we should also defer probing of the twl4030 charger instead of turing USB charging off (forever). Signed-off-by: H. Nikolaus Schaller --- drivers/power/twl4030_charger.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/power/twl4030_charger.c b/drivers/power/twl4030_charger.c index 423e886..859991f 100644 --- a/drivers/power/twl4030_charger.c +++ b/drivers/power/twl4030_charger.c @@ -1059,9 +1059,13 @@ static int twl4030_bci_probe(struct platform_device *pdev) phynode = of_find_compatible_node(bci->dev->of_node->parent, NULL, "ti,twl4030-usb"); - if (phynode) + if (phynode) { bci->transceiver = devm_usb_get_phy_by_node( bci->dev, phynode, &bci->usb_nb); + if (IS_ERR(bci->transceiver) && + PTR_ERR(bci->transceiver) == -EPROBE_DEFER) + return -EPROBE_DEFER; /* PHY not ready */ + } } /* Enable interrupts now. */