From patchwork Tue Nov 6 10:16:05 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabio Estevam X-Patchwork-Id: 10670029 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 EF41314BD for ; Tue, 6 Nov 2018 10:15:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DEB062A2D5 for ; Tue, 6 Nov 2018 10:15:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D25622A2E5; Tue, 6 Nov 2018 10:15:52 +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,FREEMAIL_FROM,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 851D22A2D5 for ; Tue, 6 Nov 2018 10:15:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387817AbeKFTkV (ORCPT ); Tue, 6 Nov 2018 14:40:21 -0500 Received: from mail-qt1-f196.google.com ([209.85.160.196]:34248 "EHLO mail-qt1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387480AbeKFTkV (ORCPT ); Tue, 6 Nov 2018 14:40:21 -0500 Received: by mail-qt1-f196.google.com with SMTP id r14so1921393qtp.1 for ; Tue, 06 Nov 2018 02:15:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=YycuJTuE1bWW4sTAZtJqKr/p103TNJLqQUkQ8hm0sHk=; b=kLxPPemysicrhQu+FOMr28/eNiDk2KzRjbVWUJzCj7xBBX5sjpaCK2TYLzlAVdLroR c45eUz6ELqj7EOhVgg+xhY7FHMIvBr8Fz8TS1GR134QQcKlFXQM4Iv6rYkCr08zJGjl1 wFhsyLUM2XLTCXqmgA2ABW5FklhXpeiD3u6Gw1qxAFgLyucYlUkiKYIH7y/7i6dAxswI Yxw1By/gRn/2UBCe5llV+u4H6zPrakkzxGH1DD4xoQcZUabhhJrZBRvHAot7Qucx/agQ iqHPUVkThP09Mt+TRyJt4/b10SH2IE/b8MQrQzxFH8+YvFy+zhnPudW+hLkiwJ7rIM38 IhXw== 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:in-reply-to :references; bh=YycuJTuE1bWW4sTAZtJqKr/p103TNJLqQUkQ8hm0sHk=; b=dVFY4ah8nnrG/DWaAmX3PjEkO5gWMzJ3QXjRBXkVDuRK7eX6XjYiqLt851wcj5vzwc +OU0s2Z0dVXIBHJCB4kQNuzpMkegu6UsVKxFaHKNXmcgP2fQbcdNxyFYBp1OTODDhsVV VQmZAYZyVlqA7sLktLyEt/ueyBwhrr1/4fqe0pQ+qsTuu9BL5dQur+L4x2i8Y9XbotPO y1/3SdNhneloP5/n7dpNmQr9yT7LhzoFScdQXkRZIaJPwE+/FwZlUgsvou01+OCfWOAw M5pvrhYDFAABZej0o+bu/s3R1U1PdYcMHnErLDe4+0kpU+GpVscXOCu4g9WQ+Dez1n2q v98g== X-Gm-Message-State: AGRZ1gLGdd8kDMaUEHHTt0VqCKRjDaBP1ag0xWOxhtG0v2qA/9EFZc0p C/i3zL8BxXSyZzUzxHYJvPU= X-Google-Smtp-Source: AJdET5ffCLdW4NeScumFYCe0nPcRHSpk3dOaMbVWzzqztZlCJgwtDyKY+9VIgCz1VFlCTnd4sunHCw== X-Received: by 2002:a0c:c966:: with SMTP id v35mr25587288qvj.45.1541499350704; Tue, 06 Nov 2018 02:15:50 -0800 (PST) Received: from localhost.localdomain ([201.82.144.36]) by smtp.gmail.com with ESMTPSA id s46sm5000062qtc.63.2018.11.06.02.15.48 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 06 Nov 2018 02:15:50 -0800 (PST) From: Fabio Estevam To: p.zabel@pengutronix.de Cc: mchehab@kernel.org, linux-media@vger.kernel.org, Fabio Estevam Subject: [PATCH v3 3/3] media: imx-pxp: Improve pxp_soft_reset() error message Date: Tue, 6 Nov 2018 08:16:05 -0200 Message-Id: <1541499365-10069-3-git-send-email-festevam@gmail.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1541499365-10069-1-git-send-email-festevam@gmail.com> References: <1541499365-10069-1-git-send-email-festevam@gmail.com> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Improve the pxp_soft_reset() error message by moving it to the caller function, associating it with a proper device and also by displaying the error code. Signed-off-by: Fabio Estevam Reviewed-by: Philipp Zabel --- Changes since v2: - None (only rebased against the change made in 2/3) drivers/media/platform/imx-pxp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/media/platform/imx-pxp.c b/drivers/media/platform/imx-pxp.c index 986764d..b80d206 100644 --- a/drivers/media/platform/imx-pxp.c +++ b/drivers/media/platform/imx-pxp.c @@ -1619,10 +1619,8 @@ static int pxp_soft_reset(struct pxp_dev *dev) ret = readl_poll_timeout(dev->mmio + HW_PXP_CTRL, val, val & BM_PXP_CTRL_CLKGATE, 0, 100); - if (ret < 0) { - pr_err("PXP reset timeout\n"); + if (ret < 0) return ret; - } writel(BM_PXP_CTRL_SFTRST, dev->mmio + HW_PXP_CTRL_CLR); writel(BM_PXP_CTRL_CLKGATE, dev->mmio + HW_PXP_CTRL_CLR); @@ -1675,8 +1673,10 @@ static int pxp_probe(struct platform_device *pdev) return ret; ret = pxp_soft_reset(dev); - if (ret < 0) + if (ret < 0) { + dev_err(&pdev->dev, "PXP reset timeout: %d\n", ret); goto err_clk; + } spin_lock_init(&dev->irqlock);