Received: by 2002:ab2:784b:0:b0:1fd:adc2:8405 with SMTP id m11csp377854lqp; Mon, 10 Jun 2024 06:59:55 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXqBpnarnJIh3CKNXSRHCc/rrmGvuyd7pHb/fEQySTU4Xb1GARXNKhB+AN2wSn+s5WNMQ5fX1lrAfvOqPGWphdY00M87IO52egc51jk6w== X-Google-Smtp-Source: AGHT+IHZ171+h2jsn3qx534hXDm6laVUeZGOipxv0BD8Pn3EUJ6HW+Jm1QE8v8xkkqUlScJCHyW4 X-Received: by 2002:a2e:a78f:0:b0:2eb:ea6f:f2c2 with SMTP id 38308e7fff4ca-2ebea700615mr18550081fa.24.1718027995057; Mon, 10 Jun 2024 06:59:55 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718027995; cv=pass; d=google.com; s=arc-20160816; b=m6ZKLJRttHEo71NnvTo1Qi+As4JQnSlleZfTgrCi2Elw+sOIRvcFA0lU+hcarWudjk 1ho9NAQZz+57gJvlJfCB80wvMzHnwLoB5k3YIrw17u8qU9e6fjmVWPyR1iMX4Jk7sSTY oy/XBCrq7At4G0GV/Xzru3oYDO9qDuErk63984L/1IVZHcotyeoYJVB0UDHiUvbMj1oy HhpTpk8LV3F4lq+SmhiW/2QTwGTtGWzCsTG06kpju6jQBTx4EWtdvkCkbY6hjD24h8ov 4ZWieKEbRYUn2vqWgFWD0Rfs4SiWNDutsPLIWqkrUZg8NEVB+FNiLMr/f4PfcZP7BknQ eA5w== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=PMGNAPlCBzzHg+7F/6Pguyh8dwXxKCu/BC3Navp4aRA=; fh=Y8qmziFMt9Id4b0tvS5WCp+mpHkh9E9p7+6TrU0SvpE=; b=Azsq3pQVsX6g+wy1DsTWHLHOpiU7OzHEuqYfphYDKxlwwl5de7J2RILtSDfhEakfxA tnPiS4GAoRn0RO6BN5frqTyLaBoI/Rhl8MUx5Upv3XtXGDrA3kTGhKmj6tsXWJ3LOd+B /gfAfmi3WYldLRWuUDQypIQ2OTdDXAz7hdOiQtdjRIEN/3OjyPhT/oo3CN94cj3xtX+7 wNR1XSgrXOq2u2SKl3bugd3O6atjuAVUoyV8n25GoZg1gfgREshMGqSUPu7nZ9/YqkhD 49pR/uJORxj8EOZYv/8RZnrhedv4QJW4O068hH4KTMgmJ6HDjONJ7LgrewrSoUs+Kaex cWtw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=lZeZR7s8; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-208301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208301-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id a640c23a62f3a-a6e27975456si342960266b.232.2024.06.10.06.59.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 10 Jun 2024 06:59:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-208301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@baylibre-com.20230601.gappssmtp.com header.s=20230601 header.b=lZeZR7s8; arc=pass (i=1 spf=pass spfdomain=baylibre.com dkim=pass dkdomain=baylibre-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-208301-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-208301-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id BE9931F2386E for ; Mon, 10 Jun 2024 13:59:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DCDB61459F0; Mon, 10 Jun 2024 13:53:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b="lZeZR7s8" Received: from mail-oo1-f46.google.com (mail-oo1-f46.google.com [209.85.161.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C9DFB839E2 for ; Mon, 10 Jun 2024 13:53:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718027620; cv=none; b=oFYnwvNPg+8YuB6cKl81ThmDLrsdJiGH8ks6jEmTFrb9uHMsTQVbwjcsks3AS+ps0a89DzbCfWZiQWlm7yHsNjX/lXmCCtxFYG9nS0MPvCcvgom+p8XRybR5mWksRNDxweq8mjVGuJDiyBtXPLV/ocqIqhWyUXBXKU7ypIbKS2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718027620; c=relaxed/simple; bh=pUwhWLC6cR4vURpqvQ+y+aCC5IaU7/FGQTa28IVLaiQ=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=KhNlIIbBQkheqcuPhjrONOU+b0FhvVfHhq7+7AdAh2nY0Cjeg1a9awIYYyjPJqtnzjmB8deI2lDjhep2N1rEpk70coOLNna2zcpfqNQPpET/84QBBOpXqv6xmRF7N5ZFVkWMkQHC38P6ZNB4Ox/ZDe3oUcqfMLgEXQNtk5KVkRo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com; spf=pass smtp.mailfrom=baylibre.com; dkim=pass (2048-bit key) header.d=baylibre-com.20230601.gappssmtp.com header.i=@baylibre-com.20230601.gappssmtp.com header.b=lZeZR7s8; arc=none smtp.client-ip=209.85.161.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=baylibre.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=baylibre.com Received: by mail-oo1-f46.google.com with SMTP id 006d021491bc7-5ba33b08550so2347194eaf.2 for ; Mon, 10 Jun 2024 06:53:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=baylibre-com.20230601.gappssmtp.com; s=20230601; t=1718027617; x=1718632417; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=PMGNAPlCBzzHg+7F/6Pguyh8dwXxKCu/BC3Navp4aRA=; b=lZeZR7s8Pb50lVkTgUIbnUtEZBDys6iBp0VDvklgaR5nR/OjqDqBlViMyCr+tJRy93 GzzX3NeFWVpHZhvPq9bgXdQ6dxv7ZmshFdfePTS5U17V6c9W2faZRalsUa5Ny5gAc1LT CTeF/a6Dxm1v1GcuDBZ4poEmo8tpXpWvxul3MQFvktUh8ZLpAE7tdYnmpSbEyUZiRYoW Mw0ugaaj0tr2z++j0fWWwgTseKgNz5k86p7DrNrVl8p7kBGgLsfN2jDsP4M9VQTvreLq GcviiC6+B7a/UDLGIHitUSQVIvDZWBTdbaJjGz2MlU97pjsKh/M1yGQPBoeTxzjZ1pPO 35lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1718027617; x=1718632417; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=PMGNAPlCBzzHg+7F/6Pguyh8dwXxKCu/BC3Navp4aRA=; b=r0d2OvFD3YCyNSiBzPykaXfDB5LpGf/InsV1sAxsOp8bZKAzoTOJoapNkaZFGaKdTo sAhxFMiGfnj7qRa6QxHhnwXORS06RssdtrglC0BIxHfUkJOclLRoe91/x8wfN0scuvXz +1MBOVXKcHkuzfbZPKf8sNdj6eFGeyyblkf3mdY3sWhA4iNQldOjOJFgRK05WivrEB7Y lLptprNk83jUTXQrnK8+5W3IhEqocsBPrO9yzQagdypkk1RXgPQURbE7bX6UZemQQj+X bV9z5LJcG+X2E7b41GG3DRnFkvyYmR/l9yVJJqKrhxd9qv+Kt5MH14UYW9WNIcV/yL6/ Dhtg== X-Forwarded-Encrypted: i=1; AJvYcCUgarBE7h9FxmpBwAT9QVq9T/sIiyVGSub3UN7MR9DNeEJvR/jRvxLJEMQpc3DOpUckvtMBhLLTOhWx/AArssMH1l2mKCGGatorwY9M X-Gm-Message-State: AOJu0YxDjD4YYK4FMaF4x3csm1xeuHw75lhdZ5RGVrByTPZKFZXRJkUs lueeFRlcdfbbkji8H8efjzSxPaLseLxP66usOfQLMWs65IOvEE69tYdnMIR4WM/l2EXNhrOwbHy l X-Received: by 2002:a05:6820:2813:b0:5ba:e995:3f03 with SMTP id 006d021491bc7-5bae9955f59mr3363948eaf.6.1718027616859; Mon, 10 Jun 2024 06:53:36 -0700 (PDT) Received: from [192.168.0.142] (ip98-183-112-25.ok.ok.cox.net. [98.183.112.25]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-5bae9f61bb1sm612751eaf.19.2024.06.10.06.53.36 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 10 Jun 2024 06:53:36 -0700 (PDT) Message-ID: Date: Mon, 10 Jun 2024 08:53:35 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH] counter: ti-eqep: enable clock at probe To: Judith Mendez , William Breathitt Gray Cc: linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org References: <20240609-ti-eqep-enable-clock-v1-1-1e9e7626467e@baylibre.com> Content-Language: en-US From: David Lechner In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On 6/10/24 8:44 AM, Judith Mendez wrote: > Hi David, > > On 6/9/24 3:27 PM, David Lechner wrote: >> The TI eQEP clock is both a functional and interface clock. Since it is >> required for the device to function, we should be enabling it at probe. >> >> Up to now, we've just been lucky that the clock was enabled by something >> else on the system already. >> >> Signed-off-by: David Lechner >> --- >>   drivers/counter/ti-eqep.c | 6 ++++++ >>   1 file changed, 6 insertions(+) >> >> diff --git a/drivers/counter/ti-eqep.c b/drivers/counter/ti-eqep.c >> index 072b11fd6b32..825ae22c3ebc 100644 >> --- a/drivers/counter/ti-eqep.c >> +++ b/drivers/counter/ti-eqep.c >> @@ -6,6 +6,7 @@ >>    */ >>     #include >> +#include >>   #include >>   #include >>   #include >> @@ -376,6 +377,7 @@ static int ti_eqep_probe(struct platform_device *pdev) >>       struct counter_device *counter; >>       struct ti_eqep_cnt *priv; >>       void __iomem *base; >> +    struct clk *clk; >>       int err; >>         counter = devm_counter_alloc(dev, sizeof(*priv)); >> @@ -415,6 +417,10 @@ static int ti_eqep_probe(struct platform_device *pdev) >>       pm_runtime_enable(dev); >>       pm_runtime_get_sync(dev); >>   +    clk = devm_clk_get_enabled(dev, NULL); >> +    if (IS_ERR(clk)) > > I think it would be nice to have print here in case the we fail to get > the clock. Do you mean that we should call devm_clk_get() and clk_prepare_enable() separately so that we get two different error messages? The dev_err_probe() below will already print a message on any error (other that EPROBE_DEFER). > > ~ Judith > >> +        return dev_err_probe(dev, PTR_ERR(clk), "failed to enable clock\n"); >> + >>       err = counter_add(counter); >>       if (err < 0) { >>           pm_runtime_put_sync(dev); >> >> --- >> base-commit: bb3f1c5fc434b0b177449f7f73ea9b112b397dd1 >> change-id: 20240609-ti-eqep-enable-clock-91697095ca81 >