Received: by 2002:a25:e74b:0:0:0:0:0 with SMTP id e72csp777932ybh; Tue, 21 Jul 2020 07:44:58 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOaqw+ZM7yZoxj/Ct5ryQ7/QjxaqHiEzV+egmK1xhraATyOtfLjqojocf7lbRgd3i6t665 X-Received: by 2002:a17:907:389:: with SMTP id ss9mr26967204ejb.56.1595342697811; Tue, 21 Jul 2020 07:44:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1595342697; cv=none; d=google.com; s=arc-20160816; b=hbFHsfnk9jNSS9SCaQHmSlopXcvQ8f1rhL3/vQcCRB94kuKFH78VzWUo/f6e+NWjBP KdnRmkqyqELn9I1F/nSrLsWFXA8Nq3M4TBjVCx2vLyhEnwxW+2wN0FO9PjMYYJYb9hxd CUgsX6i+KM8JDvYc1hSi3KHmh0ftKiM8PvmUL18gud/EuSjHjgpdD7wK7U63U44E/AfG 9eHTS92GnO7dLtv3a76nA4U3Phpv86ibNZGKTDcbfx4Cz7v4Hsfx/NJGXml+CTz1sJxz hPUJlvIAXITCeRjZgBVHrxOM0VYmLKqVIbQpI7yU2pv9OAcD2PJeAkW4cLOYqBVXvQ9K fVJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=/f+3CAnVUu/WjuKg7piRBh88qTkT5e7hVX0fEyS5bwY=; b=o9yxrHzeClDdEyIXVNQ8CeQ/+pD/szcuELOmw3ov4qzaBUK4PvTR6SvdeFtyBA9N2Z jQjAHW7eMQQx/S2RGiFxHVFzq9waXNa1as026xb4MSX2BJbCD19p6mO+xE2h1Etf46rv ekjNsMpsTL0o1u/7dw8i+fkufRRU+E4iqRzJy1narFSt7C3fFHd4Dnjjjpwtntkqr+N5 d/chrsAVqKqXeDR1hJCgRJ3SjANDt1fPMBYJ8JGaxgqd4JIvRe/yykEmJvv4/bk34GcP 9qkDRmjGL+LP/hrmT8bAvy+uJZS3p0T5zLQoxNlWRwAbGf5IjGtwkJXZj416baU+XAb6 gGtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ms7mwOup; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e9si12596664edn.579.2020.07.21.07.44.34; Tue, 21 Jul 2020 07:44:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Ms7mwOup; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729906AbgGUOoH (ORCPT + 99 others); Tue, 21 Jul 2020 10:44:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56606 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729871AbgGUOoH (ORCPT ); Tue, 21 Jul 2020 10:44:07 -0400 Received: from mail-wr1-x442.google.com (mail-wr1-x442.google.com [IPv6:2a00:1450:4864:20::442]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A14CBC061794; Tue, 21 Jul 2020 07:44:06 -0700 (PDT) Received: by mail-wr1-x442.google.com with SMTP id q5so21461820wru.6; Tue, 21 Jul 2020 07:44:06 -0700 (PDT) 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=/f+3CAnVUu/WjuKg7piRBh88qTkT5e7hVX0fEyS5bwY=; b=Ms7mwOupgucNKvHjaO51nVyunwKt6+TL6btD/qMIECU2mqYJHJGKfg0XiRiLB7OpCJ io2x9OLHnMKcDRuYwpIFmGJUw9nx+4eIGRX1JD1S5w8M1Wrhi30qUR+SWaQj1hWwOdbx rWzX12fpHhEHXa1DqPgEJal92k2p3qDfkbYvoUnQxIWle+DzQ0xhcAwa8jCEpHjFxIYC uYcKJKepMIlbAx0dF6m8BO6vmQ3hY9qnFwuY1M65G/4vLNk+pdyOC5TLRQeIBRkfGquB 45o9VO43PPPeC0ELIrcBPy72cH2PtBh1xBrARSHHxwWlIfoo/AebnNF61SHg7Bt6Q/k5 bCUw== 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=/f+3CAnVUu/WjuKg7piRBh88qTkT5e7hVX0fEyS5bwY=; b=PFzv/1GssZdM+YH4gk1vlf1FYZ/KLT07U7xTMe9wyMZIdmWzN15kG2S6ruZWtTeK1q dNRT2hLhkSAfG0ZUgvwWqr2uKcfCcDttYT0VXREFfkzj3gV1K5YFt6adEhQo1igAMvRe XwWfWEDxT6+DtcyBZtozl+0aA3JS53YkVyc/A4TBEePzkT3aTY7ooS41U0PrUSZ8onWF AzSOJfPJnTD8P0+gRhalSJrOKgxhzvbWMzoJT5rKgM+36WpLSKM73EhQocByiJlmwGfJ AlTkq84itPAd7xr8ywF5MmzIslpP1yxmN2OuVOZDT2Vh0FnpCaXyL1fIhfRNnybTQj6a e0GQ== X-Gm-Message-State: AOAM532cRKpDZBnx6AlnenycowcJT6aVg/8TknssdS5jHSA2EVT1BR8h jruV8BwcoSHt4TH4zlMXkF2LZy/O X-Received: by 2002:adf:a15c:: with SMTP id r28mr7590524wrr.151.1595342645103; Tue, 21 Jul 2020 07:44:05 -0700 (PDT) Received: from stbsrv-and-01.and.broadcom.net ([192.19.231.250]) by smtp.gmail.com with ESMTPSA id y6sm38043116wrr.74.2020.07.21.07.44.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 21 Jul 2020 07:44:04 -0700 (PDT) From: Al Cooper To: linux-kernel@vger.kernel.org Cc: Florian Fainelli , Al Cooper , devicetree@vger.kernel.org, Felipe Balbi , Florian Fainelli , Greg Kroah-Hartman , linux-usb@vger.kernel.org, Rob Herring , Sasi Kumar Subject: [PATCH v2 7/7] usb: bdc: Use devm_clk_get_optional() Date: Tue, 21 Jul 2020 10:43:26 -0400 Message-Id: <20200721144326.7976-8-alcooperx@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200721144326.7976-1-alcooperx@gmail.com> References: <20200721144326.7976-1-alcooperx@gmail.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Florian Fainelli The BDC clock is optional and we may get an -EPROBE_DEFER error code which would not be propagated correctly, fix this by using devm_clk_get_optional(). Signed-off-by: Florian Fainelli Signed-off-by: Al Cooper --- drivers/usb/gadget/udc/bdc/bdc_core.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/drivers/usb/gadget/udc/bdc/bdc_core.c b/drivers/usb/gadget/udc/bdc/bdc_core.c index c1650247ea39..f6e4026618e8 100644 --- a/drivers/usb/gadget/udc/bdc/bdc_core.c +++ b/drivers/usb/gadget/udc/bdc/bdc_core.c @@ -497,11 +497,9 @@ static int bdc_probe(struct platform_device *pdev) dev_dbg(dev, "%s()\n", __func__); - clk = devm_clk_get(dev, "sw_usbd"); - if (IS_ERR(clk)) { - dev_info(dev, "Clock not found in Device Tree\n"); - clk = NULL; - } + clk = devm_clk_get_optional(dev, "sw_usbd"); + if (IS_ERR(clk)) + return PTR_ERR(clk); ret = clk_prepare_enable(clk); if (ret) { -- 2.17.1