From patchwork Sun Feb 21 11:28:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Pali_Roh=C3=A1r?= X-Patchwork-Id: 8369061 Return-Path: X-Original-To: patchwork-linux-omap@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 9B5C09F314 for ; Sun, 21 Feb 2016 18:31:31 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id B52C620412 for ; Sun, 21 Feb 2016 18:31:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D07AA203EC for ; Sun, 21 Feb 2016 18:31:29 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751761AbcBUSbQ (ORCPT ); Sun, 21 Feb 2016 13:31:16 -0500 Received: from mail-wm0-f44.google.com ([74.125.82.44]:37688 "EHLO mail-wm0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751560AbcBUSbO (ORCPT ); Sun, 21 Feb 2016 13:31:14 -0500 Received: by mail-wm0-f44.google.com with SMTP id g62so135450375wme.0; Sun, 21 Feb 2016 10:31:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=6azjf4m/z4fvbh0/nWLMvTwEv5/jq8sErz3Tw0vEzTQ=; b=WhqTG05BhH4+toCxnUcHAJoFZTyXJrnwpncJeRfdG7Ac02nFQYaFgfkkQJnXLvSVvO moo0NKtJRXYcEIbSWAIogsibsUsXFUSWKZ/o2Ba9zCKEIVVyMGQBl3u+blZgphvlJRh7 gRi3YPLEXEVmcJa8czvCdiFXNfyp8W4w9QdIBar/1PVw3z7q5tjSvuqSN2Bo0ZWNPHxP wsxGNDGpjXHGBQOKAQorTMSn9qZ0GUF8KC+GdSm0toc+ZqbemWbM056jCusL2oJLezqp dQCAkNnLF/ilFWFbk56AKzBdPSQdMKTz9qQhtZe6kYLH4Db47aOcj8nu2FDz4+sSRhcP SQow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=6azjf4m/z4fvbh0/nWLMvTwEv5/jq8sErz3Tw0vEzTQ=; b=QoFj6W+b2zcgxyN/h8plh+jQMEm9AEPkSTWHEP2zYASp+MhJOXpap5FxsrDEDA5U2u m+7opkKluqCRUTI5FlAvLypWKFXLub9dyVUaJlZ0VjOJB66G1d06Yar8WO0EQKgOP0N+ 5c4CWtAsgK2ddfzTQY2Vl7T4BwyT+PvbQwZZBCHTJ+8v9u5ltFlqIU0m8ntKUVfc0PiH IjhPApHjUWp6gJWy5rwL/ik2hRVvUDG8JIZV/IJ8XZh88/m/0FscPygpr9MzEYBCfv6J 0NGs3MCAdnGsOp9VrS9qyr9wpOGOCRRzoIBnjjpXPLLUzKoxJOmYu1UTqajDQzEUtnN0 /xFg== X-Gm-Message-State: AG10YORzKwkanVwBvcmynb7E0DUSQMwJ1NyqXj9p10Yz+juivsU7dfX+2EmVNj9EEWquFA== X-Received: by 10.28.137.139 with SMTP id l133mr7283610wmd.1.1456054136748; Sun, 21 Feb 2016 03:28:56 -0800 (PST) Received: from localhost.localdomain (pali.kolej.mff.cuni.cz. [78.128.193.202]) by smtp.gmail.com with ESMTPSA id jc7sm19670939wjb.33.2016.02.21.03.28.55 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 21 Feb 2016 03:28:56 -0800 (PST) From: =?UTF-8?q?Pali=20Roh=C3=A1r?= To: =?UTF-8?q?Beno=C3=AEt=20Cousson?= , Tony Lindgren , Sebastian Reichel , Dmitry Eremin-Solenikov , David Woodhouse , Pavel Machel , Aaro Koskinen , Ivaylo Dimitrov , Nishanth Menon Cc: linux-pm@vger.kernel.org, linux-omap@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, =?UTF-8?q?Pali=20Roh=C3=A1r?= Subject: [PATCH 1/6] power_supply: isp1704_charger: Error messages when probe fail Date: Sun, 21 Feb 2016 12:28:18 +0100 Message-Id: <1456054103-19551-2-git-send-email-pali.rohar@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1456054103-19551-1-git-send-email-pali.rohar@gmail.com> References: <1456054103-19551-1-git-send-email-pali.rohar@gmail.com> MIME-Version: 1.0 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, 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 patch adds more detailed error messages when probe function fail. It is useful for debbuging why driver refuse to register charger device. Signed-off-by: Pali Rohár --- drivers/power/isp1704_charger.c | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/drivers/power/isp1704_charger.c b/drivers/power/isp1704_charger.c index 46a292a..acaf7cf 100644 --- a/drivers/power/isp1704_charger.c +++ b/drivers/power/isp1704_charger.c @@ -411,8 +411,10 @@ static int isp1704_charger_probe(struct platform_device *pdev) if (np) { int gpio = of_get_named_gpio(np, "nxp,enable-gpio", 0); - if (gpio < 0) + if (gpio < 0) { + dev_err(&pdev->dev, "missing DT GPIO nxp,enable-gpio\n"); return gpio; + } pdata = devm_kzalloc(&pdev->dev, sizeof(struct isp1704_charger_data), GFP_KERNEL); @@ -422,8 +424,10 @@ static int isp1704_charger_probe(struct platform_device *pdev) ret = devm_gpio_request_one(&pdev->dev, pdata->enable_gpio, GPIOF_OUT_INIT_HIGH, "isp1704_reset"); - if (ret) + if (ret) { + dev_err(&pdev->dev, "gpio request failed\n"); goto fail0; + } } if (!pdata) { @@ -443,6 +447,7 @@ static int isp1704_charger_probe(struct platform_device *pdev) if (IS_ERR(isp->phy)) { ret = PTR_ERR(isp->phy); + dev_err(&pdev->dev, "usb_get_phy failed\n"); goto fail0; } @@ -452,8 +457,10 @@ static int isp1704_charger_probe(struct platform_device *pdev) isp1704_charger_set_power(isp, 1); ret = isp1704_test_ulpi(isp); - if (ret < 0) + if (ret < 0) { + dev_err(&pdev->dev, "isp1704_test_ulpi failed\n"); goto fail1; + } isp->psy_desc.name = "isp1704"; isp->psy_desc.type = POWER_SUPPLY_TYPE_USB; @@ -466,6 +473,7 @@ static int isp1704_charger_probe(struct platform_device *pdev) isp->psy = power_supply_register(isp->dev, &isp->psy_desc, &psy_cfg); if (IS_ERR(isp->psy)) { ret = PTR_ERR(isp->psy); + dev_err(&pdev->dev, "power_supply_register failed\n"); goto fail1; } @@ -478,8 +486,10 @@ static int isp1704_charger_probe(struct platform_device *pdev) isp->nb.notifier_call = isp1704_notifier_call; ret = usb_register_notifier(isp->phy, &isp->nb); - if (ret) + if (ret) { + dev_err(&pdev->dev, "usb_register_notifier failed\n"); goto fail2; + } dev_info(isp->dev, "registered with product id %s\n", isp->model);