From patchwork Fri May 5 12:52:33 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Bailon X-Patchwork-Id: 9713523 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3663C6034B for ; Fri, 5 May 2017 12:54:22 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27FE92869A for ; Fri, 5 May 2017 12:54:22 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B1B6286B8; Fri, 5 May 2017 12:54:22 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID 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 205F82869A for ; Fri, 5 May 2017 12:54:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751754AbdEEMyT (ORCPT ); Fri, 5 May 2017 08:54:19 -0400 Received: from mail-wr0-f172.google.com ([209.85.128.172]:33353 "EHLO mail-wr0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751788AbdEEMyT (ORCPT ); Fri, 5 May 2017 08:54:19 -0400 Received: by mail-wr0-f172.google.com with SMTP id w50so3367352wrc.0 for ; Fri, 05 May 2017 05:54:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=SKRtL8rXvzdf1UpZYONXhDmo0Fl0lODjHEwaEPLMwGI=; b=A6bmPVp/C26yksqdfRH4ISbTAifhvLI9GVgb5qVw1m2F8We1paTR79Ezk/ORrH+S9X oRLtzpgsur+1LJ9wtrueNj/Wvtn3rjhobUB1k79rPXCnLgRZsYtKEGy7ct3oS2yMReph RznATz4UbKcOExLGxstmO6Z8qxKRj4umGzfCxRpA3/GGVl5KTmY6hhymE8ntyms3bCWJ E+yZaHVxXqhe7Agq+iuwQfwajrUvzdoMY8CnqUKSlbmvB4FY2rRSxCQ69rSvqDr09lQd fCHzC5rSz6yghcOSE7CST69MaaTNNkEcfMJ4ax5uiDv5/sASFQ4OtDMLH/BI987kP4Rf GjzQ== 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; bh=SKRtL8rXvzdf1UpZYONXhDmo0Fl0lODjHEwaEPLMwGI=; b=AJxop0Hctf+E9n5MLapm3vwUAhJg4LOcUpKKL07m/FpVj/Z+EyVs/mOHKFjusMAgUV aFJR7uMfOcCTjC0jpp0PqMumRg5K71z/98BDrMNW7Lea71lfltSG0At7HWWSJRD8TlRp Vi4cpjUyr3dL3Ls7NjW1oLd3zNW1rQki8oZ5pWz4mvrbGEiixdlMqU6VPnVK6hjJBZnH MjJNH1qfoVPo+LQ2bNUZh9tyhBIPWM6iYFoq2m3EdWCbwJ5V0nKcO3ECeuy9Pwx7YkQ0 7m7i+1cwKZKw9hZaf4iLZtWFQU9wCI1xfjRaItQW8l48KAbL937lPwxscg1L6MtsXnac zuIg== X-Gm-Message-State: AN3rC/4fLikfT3M98EOLWWYJJRePk547KTKQs0PORWG7uSU/VUzoRKmq SD3q7vb1miCE/G0Q X-Received: by 10.223.175.46 with SMTP id z43mr36935483wrc.84.1493988857826; Fri, 05 May 2017 05:54:17 -0700 (PDT) Received: from localhost.localdomain ([90.63.244.31]) by smtp.gmail.com with ESMTPSA id w18sm4720904wra.34.2017.05.05.05.54.16 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 05 May 2017 05:54:17 -0700 (PDT) From: Alexandre Bailon To: b-liu@ti.com Cc: linux-usb@vger.kernel.org, nsekhar@ti.com, ptitiano@baylibre.com, sergei.shtylyov@cogentembedded.com, linux-omap@vger.kernel.org, Alexandre Bailon Subject: [PATCH v2] usb: musb: musb_cppi41: Update an error message Date: Fri, 5 May 2017 14:52:33 +0200 Message-Id: <20170505125233.27015-1-abailon@baylibre.com> X-Mailer: git-send-email 2.10.2 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If dma_request_slave_channel() failed to return a channel, then the driver will print an error and request to defer probe, regardless of the cause of the failure. Only defer if the DMA is not ready yet and print an error to explain that we are deferring probe. Signed-off-by: Alexandre Bailon --- drivers/usb/musb/musb_cppi41.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/usb/musb/musb_cppi41.c b/drivers/usb/musb/musb_cppi41.c index e7c8b1b..4718d0d 100644 --- a/drivers/usb/musb/musb_cppi41.c +++ b/drivers/usb/musb/musb_cppi41.c @@ -673,10 +673,12 @@ static int cppi41_dma_controller_start(struct cppi41_dma_controller *controller) musb_dma->status = MUSB_DMA_STATUS_FREE; musb_dma->max_len = SZ_4M; - dc = dma_request_slave_channel(dev->parent, str); - if (!dc) { - dev_err(dev, "Failed to request %s.\n", str); - ret = -EPROBE_DEFER; + dc = dma_request_chan(dev->parent, str); + if (IS_ERR(dc)) { + ret = PTR_ERR(dc); + dev_err(dev, "Failed to request %s%s.\n", str, + ret == -EPROBE_DEFER + ? ", deferring probe" : ""); goto err; } cppi41_channel->dc = dc;