From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 784BAC433F5 for ; Thu, 5 May 2022 13:44:54 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 687ED83BF4; Thu, 5 May 2022 15:44:52 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=denx.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1651758292; bh=P+IBEUHb/MQrCuc8muZcbBfRldYqxRd1EZ45bu/YY6w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=yKqu01OTsZx/o0n+aNOwG+DaHqRZ2MwdpIxI0xnV94qPigUQsCHuDHQLlDMNegEgT 3Qya6ftDvmmRkKXnxdLHUvxx6zpP3pRjzJt8eIBa6l7XDjOFGOYr2VbFG28wJa838+ 6rALZlLcYRg7drxthUIS8UnAkOrF8eRZlX9s2G60RL0KLUCCFPdVGmKur87SIDgaZO JMTr0sgoVinvJxOTvJEofeDrvFd/Od6ByD4tD8nRCqljkL8JZyG4ymfdH3mLJjo/fO RwJ9UcpaYOzdt0r3/3AopQGaoAuVICZXcBDEZ1EFlnrGePbLbGuTT6Oe6X+PwggnbP 8r3y7eK4eW9Ow== Received: from [127.0.0.1] (p578adb1c.dip0.t-ipconnect.de [87.138.219.28]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: marex@denx.de) by phobos.denx.de (Postfix) with ESMTPSA id BC02683D7D; Thu, 5 May 2022 15:44:50 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=denx.de; s=phobos-20191101; t=1651758291; bh=P+IBEUHb/MQrCuc8muZcbBfRldYqxRd1EZ45bu/YY6w=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=lm64nekNz0QMAnXurhW0PUxQl8ax+aSqqTg0Z/U8uaF/81Eb6oD6OdYkvd6GuzsQn tsokpfgn4CHKE3B2q3B5lzsMRDX0lV7/sha5aVfwALytfX//z8HjLQ+DjeC8UXo/Ty ZZ+lPOReFM/uiXWIoHQkKeYhwIZE6RbKIB11T9QHRLkT1mYteRpI5/RH24dG4aYLiA botvto1nc6ewNQozgqPzdgIAuMINGVosn+MEQNsJGL1i+nKFNOuYUjD/AZPo4osfI6 5ZcIUHteFt+elrCqpKfxShf6Qh5FfgSOu0HXIVZaL2ahIlYbGKXdncJpf/hVwB3glD vrREgZRvMaBVg== Message-ID: <40514ed1-9899-059f-0010-eb6b972c217a@denx.de> Date: Thu, 5 May 2022 15:44:50 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.8.1 Subject: Re: [PATCH 1/2] usb: host: ehci-generic: Make usage of clock/reset bulk() API Content-Language: en-US To: Patrice Chotard , u-boot@lists.denx.de Cc: Patrick DELAUNAY , U-Boot STM32 References: <20220505151756.1.Ia5711b14a17cf1d042bdab9d3f28437d5c53272c@changeid> From: Marek Vasut In-Reply-To: <20220505151756.1.Ia5711b14a17cf1d042bdab9d3f28437d5c53272c@changeid> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean On 5/5/22 15:17, Patrice Chotard wrote: [...] > @@ -81,68 +79,31 @@ static int ehci_usb_probe(struct udevice *dev) > struct generic_ehci *priv = dev_get_priv(dev); > struct ehci_hccr *hccr; > struct ehci_hcor *hcor; > - int i, err, ret, clock_nb, reset_nb; > + int err, ret; > > err = 0; > - priv->clock_count = 0; > - clock_nb = ofnode_count_phandle_with_args(dev_ofnode(dev), "clocks", > - "#clock-cells", 0); > - if (clock_nb > 0) { > - priv->clocks = devm_kcalloc(dev, clock_nb, sizeof(struct clk), > - GFP_KERNEL); > - if (!priv->clocks) > - return -ENOMEM; > - > - for (i = 0; i < clock_nb; i++) { > - err = clk_get_by_index(dev, i, &priv->clocks[i]); > - > - if (err < 0) > - break; > - err = clk_enable(&priv->clocks[i]); > - if (err && err != -ENOSYS) { > - dev_err(dev, "failed to enable clock %d\n", i); > - clk_free(&priv->clocks[i]); > - goto clk_err; > - } > - priv->clock_count++; > - } > - } else { > - if (clock_nb != -ENOENT) { > - dev_err(dev, "failed to get clock phandle(%d)\n", > - clock_nb); > - return clock_nb; > - } > + ret = clk_get_bulk(dev, &priv->clocks); > + if (ret) { > + dev_err(dev, "Failed to get clocks\n"); Print the error code in the error message, so the user can immediately determine what went wrong without rebuilding the code with extra debug prints (and that goes for other messages and other drivers too, the error code is useful there). dev_err(dev, "Failed to get clocks (ret=%d)\n", ret); [...]