Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp628308pxb; Sat, 16 Jan 2021 01:58:21 -0800 (PST) X-Google-Smtp-Source: ABdhPJxdW7J5Fx6vxqQGFivsroFeV3X/Maohb33ipatTFvL8ZubBS2JYkdZzL2lRaQqsMcM/i8V2 X-Received: by 2002:a17:906:c00c:: with SMTP id e12mr11358834ejz.103.1610791101597; Sat, 16 Jan 2021 01:58:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610791101; cv=none; d=google.com; s=arc-20160816; b=yZmJZCx3LpL2T+MIFgKVfDvXNgLCEEfDVQAulCCIKaJ1ast07uTOSxjhII6T6nGg6m Hzoul73tpAG9d38gxIKCX2Q8FBIzWA88WfW+UJsJR+5CNPSExZ/fupXL7AGmXVGoef0m t/M7WxpkKSdO0/2gpykvmwvhFUGpYEDKyL+ad7Psb/TI5FzP51nnL7l4n3cXSowbpa// rwUGqB2PWYGDPrR7caX5lPLGgFBD1RrrQRU2xhCZ40RjZMMf4BTDHx0WtKfVFGQVm/6J 1PIaKSJbNgOawWgLiy30jHzYAGZM7d5f38mZNu1u6LN3/XTIeFLURAAPcMg/8AApYRiy H+3w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=y28tRJhhoiCvoELiMGKRKxElE6yxaeeck1yAOz8t9W8=; b=ZuSEAESVYOGkxNojsVr2dGO2LG00KCG0QjPbFOC1EiQTMZ2eRvqKWmnPJ7R/oeA2D8 OX0hO7s3bXPW8bx8+h2AOha0UGCdCnkOf660KQ50+1HtV9Be9XA2SZM05rQTXn/svz9R A315M/+n181q1jgDXq7ZXgQzDC5DoDksdqCheKVokou1MOVgWiqniKX76Hpp+9fq4PFa 95ZOP9IQYJP/sbniZ7mlv1mJmgV68cHmreLju98nuDI6kiFx2vywjX2q1rVC3IY8ZXT5 BlfB5AfxpkJsG+eKQgS3Y/FIzNSC0LEEt7x+lJ2TRAJrV2FPQdUHDlnzMTx74Y+hH7dn rbwQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="czdMl4/K"; 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 ga25si783695ejc.296.2021.01.16.01.57.57; Sat, 16 Jan 2021 01:58:21 -0800 (PST) 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="czdMl4/K"; 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 S1726712AbhAPJzy (ORCPT + 99 others); Sat, 16 Jan 2021 04:55:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726595AbhAPJzx (ORCPT ); Sat, 16 Jan 2021 04:55:53 -0500 Received: from mail-lf1-x12e.google.com (mail-lf1-x12e.google.com [IPv6:2a00:1450:4864:20::12e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 83972C061757; Sat, 16 Jan 2021 01:55:12 -0800 (PST) Received: by mail-lf1-x12e.google.com with SMTP id u25so16899631lfc.2; Sat, 16 Jan 2021 01:55:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:organization:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=y28tRJhhoiCvoELiMGKRKxElE6yxaeeck1yAOz8t9W8=; b=czdMl4/Ku/KwisqwYx7KcjKBaYlnKeThg912tzF/uIRJbOhIlk8/52MbhNjr9elSN7 09NNCpDQaxTfVRcB3Z929Xmd8PSTmFTGMbQqdd8yjImeVmPBk+OCM0PUrjpJDAzP0ISU iKcInFIcLyVlwOV2yR/Fds5vU4uSHBhwUGFpUG4StXMviwtNrWwDzHfhd0FPXiCSHcUi NN1dRTFSFC6/nE8sjsHKz+FnL1PEa5be29c8HZmfU0R7Y5Fm/4arFLNIONv4X4eGtagW XTzKQKV4ak/C49rjC4oxWkU/TEzs+jz9Jpj3T6eBtPJGNCOazFzLMQr+9JoMM1gZCFXG FpWg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=y28tRJhhoiCvoELiMGKRKxElE6yxaeeck1yAOz8t9W8=; b=hPfxlpFrs3Sj4w3meHUleaTRgiMwc1wKSzIWLu6HpoGRzELPyiz9/jHXnvv6MxR+et 4letNOBzzjx/8Mf/heCwaEpjh9BZd2+wxyeq8Zye280JS0bXSzLDZDWPGi5LuKyjIESW oAIeub8wNRkr3okwno8NFkzvno2fRyW4fqZ0E0AcKkUu8q5noq9+M/29iIlusaOryvXO US0jF85f+0xsIyAJg/K4Nakz8Z70bBEq2PxbTtzFV+5nNDCnKHouc/ZZ5qx3UMrVlizq /rJy9KwQzsq2c0VcN4Wsnm0pJpjom9mXYgqfY8/L2AozlDAtCQayck32Ctdr5i8LZ16P Tnrg== X-Gm-Message-State: AOAM530Vc6wi5PLEmfcPTrAOyaHV4tIWX0Wk6W9qpDzMjukDup0BfOQj 3vX5iRV7I5L1Op+nxGt8brFnqTteKWpbkA== X-Received: by 2002:a19:997:: with SMTP id 145mr8093829lfj.588.1610790910957; Sat, 16 Jan 2021 01:55:10 -0800 (PST) Received: from [192.168.1.100] ([178.176.75.157]) by smtp.gmail.com with ESMTPSA id t17sm1221138lfr.5.2021.01.16.01.55.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 16 Jan 2021 01:55:10 -0800 (PST) Subject: Re: [PATCH V2 4/4] net: ethernet: ravb: Enable optional refclk To: Adam Ford , linux-renesas-soc@vger.kernel.org Cc: aford@beaconembedded.com, "David S. Miller" , Jakub Kicinski , Rob Herring , Geert Uytterhoeven , Magnus Damm , netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org References: <20210115201953.443710-1-aford173@gmail.com> <20210115201953.443710-4-aford173@gmail.com> From: Sergei Shtylyov Organization: Brain-dead Software Message-ID: Date: Sat, 16 Jan 2021 12:55:07 +0300 User-Agent: Mozilla/5.0 (Windows NT 6.3; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 MIME-Version: 1.0 In-Reply-To: <20210115201953.443710-4-aford173@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello! On 15.01.2021 23:19, Adam Ford wrote: > For devices that use a programmable clock for the avb reference clock, AVB. > the driver may need to enable them. Add code to find the optional clock > and enable it when available. > > Signed-off-by: Adam Ford [...] > diff --git a/drivers/net/ethernet/renesas/ravb_main.c b/drivers/net/ethernet/renesas/ravb_main.c > index bd30505fbc57..739e30f45daa 100644 > --- a/drivers/net/ethernet/renesas/ravb_main.c > +++ b/drivers/net/ethernet/renesas/ravb_main.c > @@ -2148,6 +2148,14 @@ static int ravb_probe(struct platform_device *pdev) > goto out_release; > } > > + priv->refclk = devm_clk_get_optional(&pdev->dev, "refclk"); > + if (IS_ERR(priv->refclk)) { > + error = PTR_ERR(priv->refclk); > + goto out_release; > + } else { No need for *else* after *goto*. > + (void)clk_prepare_enable(priv->refclk); You can really omit (void)... Also, I'm not seeing where do you call clk_disable_unprepare()... [...] MBR, Sergei