Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2263245pxk; Sat, 5 Sep 2020 15:11:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwC6wv1yCPd2V8K7xbiuhkzav80g6Vp+ETeyKvnFohTS8k/Wk0U9G2KYh5cf5TzaVX5DLdc X-Received: by 2002:a17:906:5856:: with SMTP id h22mr13917059ejs.480.1599343917569; Sat, 05 Sep 2020 15:11:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1599343917; cv=none; d=google.com; s=arc-20160816; b=dg9/OiaaEb6isp7C+YC+jdikYQDE2bl9T2PgClANGztlaGKKJc0GgvtMvxwq7CcbbE DjR0rAw/1QWxvqEcE2n1/sCOXrGc3V1m5BLjPLCW4VVj167mB4WzVb62eA0hu4b+cICT cEemXnef+7va5Lt3WPzKmN2HppXXFpIRuaKcOzU/s+NOJ9hKrezQ2kVFZECUinTP8Dka svFweF259252tBbY6TnXUOzE4MJnH9t6aFPhKUpM2wEi5B5oz1q1BA7z8yDgXCO7bD/H MsLaPwEtacjG1mZfzlups2bBJMctMSfqLcMk9bavMX+M9G8w3yVvRursExD+/eFGsWiF Q2fA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=8MoLpRkBfSBRX/tGugQ+DszGpTDOMxPXdZr3qQMsksg=; b=Wt6VpK/+xokCj7VS6vS+qEUh9Hr2YC2BnrOdO6nMEyK5ONzJA2vzVbJh6InefIE8mf bpl4YT2q/vG3LwovjPzCIroni++RTrpBFzUiuy/fL5RPyz9hrvK5IY4aH0jtHmSq21N7 t0CoagTViqtWgCPJfg34gdUTCbruklGOSbljomyAUc1zQQ2fwjVPrAwmiP8dMa4MlAnE uET15ZO3jrBD9+0iqEDc8PvuR8q152VepF0vk6tiKMq9w85NRnleqm2S6KDWkBJ9s55v kBXuPeymMablkYqHU+e3hznQ/YXh7A9fmfX/8HefGPCBaqxXYZwTgIeoJO3KI6wZXtwT OI7w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=Dcwm1rE6; 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 i5si6754382ejs.267.2020.09.05.15.11.34; Sat, 05 Sep 2020 15:11: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=Dcwm1rE6; 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 S1728782AbgIEWIp (ORCPT + 99 others); Sat, 5 Sep 2020 18:08:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728589AbgIEWIn (ORCPT ); Sat, 5 Sep 2020 18:08:43 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF265C061244; Sat, 5 Sep 2020 15:08:41 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id u27so5629859lfm.13; Sat, 05 Sep 2020 15:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=8MoLpRkBfSBRX/tGugQ+DszGpTDOMxPXdZr3qQMsksg=; b=Dcwm1rE6sy/AQgDcUMWsBXrmBU1E+t1K3CGdxIDOyyn13yLOZYeNlBWljrWE3KW11+ ADtRvVNAq2oGO+ttYkTeUsIB0q+cUJZ1mW2nLqsgjIY8LWM8WWys6ED+nFzYqm9u2KGt Rb1LJ1kR514fvxT9EfLlIcPf203AK5074hGT0vocAEZrPi/f/ngCMkgtEkbBt5tBo08h 08syr6svVSKKZc3D1NjZMDVmiUjbAYq2zaEO9CGuiIBd0lBpQItQ74SYfYGPeI6TdXlL U5O+bek1ky6Wgmuq5B1O/unVqdDtrnxmjOXDOAPLRBWJZLPPVSPII6foKPtZmr8l7dRJ UeMA== 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:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=8MoLpRkBfSBRX/tGugQ+DszGpTDOMxPXdZr3qQMsksg=; b=KA3BzOw1n8xoQqtgE1kQ1/Y3c9DeWvJfCKnTQgru3O5W68+NBdaN4uR3w/uv804ZUB ZDysDaK+0AOmd/H3FQjXnNtLEpcM80MBNMqOgPUtybgd3d+VX64E6HyPfO/SEDdP1o4L nYnkBlKDSap2p4eO2zF8McnDD3uy3Kh5tWpGkyDLrPBnh9KEknS2yMrrU8OqqP6F9M74 iLbNKeWT/63iH45M2hgwTdUjioSZ5+ScOj2wFmJXP1VsonQ2SPkjTUEKEPHUSGVsCtRZ j2+uN/QwzsI/MkN7YkkLAI3bk8SXAyEZBPS09gWGY7R3o7Jaj1GJk0E3HRpEBlTJXVqR 64Cg== X-Gm-Message-State: AOAM532fruyLNg2L9lHRzMUIuvy5zYCaFd178p9ZsMvbNNfurMA9QN3U 7U+SO0El8LjRPHIZzMJlh1guQIha/9o= X-Received: by 2002:ac2:5de8:: with SMTP id z8mr6817344lfq.204.1599343720193; Sat, 05 Sep 2020 15:08:40 -0700 (PDT) Received: from [192.168.2.145] (109-252-170-211.dynamic.spd-mgts.ru. [109.252.170.211]) by smtp.googlemail.com with ESMTPSA id j23sm2441730ljh.96.2020.09.05.15.08.39 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 05 Sep 2020 15:08:39 -0700 (PDT) Subject: Re: [PATCH v4 10/31] i2c: tegra: Use clk-bulk helpers To: =?UTF-8?B?TWljaGHFgiBNaXJvc8WCYXc=?= Cc: Thierry Reding , Jonathan Hunter , Laxman Dewangan , Wolfram Sang , Andy Shevchenko , linux-i2c@vger.kernel.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200905204151.25343-1-digetx@gmail.com> <20200905204151.25343-11-digetx@gmail.com> <20200905215608.GA18554@qmqm.qmqm.pl> From: Dmitry Osipenko Message-ID: Date: Sun, 6 Sep 2020 01:08:38 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20200905215608.GA18554@qmqm.qmqm.pl> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 06.09.2020 00:56, Michał Mirosław пишет: > On Sat, Sep 05, 2020 at 11:41:30PM +0300, Dmitry Osipenko wrote: >> Use clk-bulk helpers and factor out clocks initialization into separate >> function in order to make code cleaner. > [...] >> --- a/drivers/i2c/busses/i2c-tegra.c >> +++ b/drivers/i2c/busses/i2c-tegra.c > [...] >> static const struct tegra_i2c_hw_feature tegra194_i2c_hw = { >> .has_continue_xfer_support = true, >> .has_per_pkt_xfer_complete_irq = true, >> - .has_single_clk_source = true, >> .clk_divisor_hs_mode = 1, >> .clk_divisor_std_mode = 0x4f, >> .clk_divisor_fast_mode = 0x3c, > [...] >> +static int tegra_i2c_init_clocks(struct tegra_i2c_dev *i2c_dev) >> +{ >> + unsigned int i; >> + int err; >> + >> + err = devm_clk_bulk_get_all(i2c_dev->dev, &i2c_dev->clocks); >> + if (err < 0) >> + return err; >> + >> + i2c_dev->nclocks = err > [...] > > You loose checking whether number of clocks matches the device version. > Is this intended? Yes, it's not needed. The check wasn't really needed in the first place.