Received: by 2002:a25:ef43:0:0:0:0:0 with SMTP id w3csp61246ybm; Thu, 28 May 2020 16:06:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyOzbCPhzdF6ThjedyZtoylU+B9caXN4QJZP+2udP+NT5iK2K2mrAQZnC0UZ5DJs3Zzlfe2 X-Received: by 2002:a05:6402:1a48:: with SMTP id bf8mr5658679edb.133.1590707202221; Thu, 28 May 2020 16:06:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590707202; cv=none; d=google.com; s=arc-20160816; b=Xv+ZkqTI4OGVa0H0QjSR7RvKYzto1AGZPEbccricSmjqZF8y7sZa2brnlbmCNFvh8x LpAUJukQGp4p+OUEBEU6CjGnSUKzxKqBNwlLWlfqiLZc20C6k8nO4UYsmkyLwphgIgsW Nj76XmOEbcN9FK/q34wbv5O4Ukgny0MHxQKFf++4t4udxiUQHdxrM1yNMcLZ308c7Pkq 9NVs/vcUbMp6MO0Uusve/eoplZ2eZTiUeusaoIY4g9xPfmhrQZUwfUCRk7/li39vzY7R 5FrF74ah/pXgGYjNQqRk8uux/SOZRDQ43rStDRrxORGlaN0PPs06tAebDuJRipq8C7Gc 3hqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:date:to:cc:from :subject:references:in-reply-to:content-transfer-encoding :mime-version:dkim-signature; bh=AwQh/Z5dE3PvNZvMfXgCYlntTVYdDkWce9DobLD86rE=; b=WKISnjXLV6f4N41x28ChqJ40tcKBbhmzNDwye6Nt56pW3Kp9eSjOkmSmQk1jyHBbIu 8WVWdpZj7RgcKvbDYZBELDHlfzk8TNtvPrTU/W0FUe56sAGCeLVqcAO7QEdz0A5s6xD2 yLQIXC6Ucl/9aE340zO0HUlwfwZUOhJjy9hWImQb1OJQuG00XPYGYtNSxS5fYo2q+F6s pUfdXqRjWQs2nbwzhU/ZaHWUUDz6akOwW25UOHngDw6HQgmvCpFldUtaRHZx0pd0FBx5 2ZuMRhGq1qer3/ayb1YD4bn/cEpTveCzabN11dc6KwDvFHKtWOIriEOk3WE/NfVXmFkP BuAA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=KC0Twjga; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h7si4284779edz.91.2020.05.28.16.06.05; Thu, 28 May 2020 16:06:42 -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=@kernel.org header.s=default header.b=KC0Twjga; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2437446AbgE1XD0 (ORCPT + 99 others); Thu, 28 May 2020 19:03:26 -0400 Received: from mail.kernel.org ([198.145.29.99]:48026 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2437385AbgE1XDP (ORCPT ); Thu, 28 May 2020 19:03:15 -0400 Received: from kernel.org (unknown [104.132.0.74]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 3206B207F9; Thu, 28 May 2020 23:03:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590706995; bh=AwQh/Z5dE3PvNZvMfXgCYlntTVYdDkWce9DobLD86rE=; h=In-Reply-To:References:Subject:From:Cc:To:Date:From; b=KC0TwjgabgvXc4Y7ZE4f+fdTNNSpjXdSnNiU52VALuT/cB4nDEVYdbAS3g6Ae9iQ1 FxeIIzDgFsXqBc48e63Rm+XAGmMqhLIHl0F/7oRd2SJ6sfE8RqClhmsB+px2OMajbl wpqzhX6rLTgYGH2lSMPz6Bkz5qeynkjSjUDx5nLM= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable In-Reply-To: <1j8shbkhsq.fsf@starbuckisacylon.baylibre.com> References: <20200519170440.294601-1-jbrunet@baylibre.com> <1j8shbkhsq.fsf@starbuckisacylon.baylibre.com> Subject: Re: [PATCH] clk: add api to get clk consummer from clk_hw From: Stephen Boyd Cc: linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org To: Jerome Brunet , Martin Blumenstingl Date: Thu, 28 May 2020 16:03:14 -0700 Message-ID: <159070699457.69627.14852370592791335742@swboyd.mtv.corp.google.com> User-Agent: alot/0.9 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Jerome Brunet (2020-05-28 11:58:45) >=20 > On Wed 27 May 2020 at 22:07, Martin Blumenstingl wrote: >=20 > > Hi Jerome, > > > > On Tue, May 19, 2020 at 7:09 PM Jerome Brunet wr= ote: > > [...] > >> + * Calls to this function must be balanced with calls clk_put() > >> + */ > >> +struct clk *clk_hw_get_clk(struct clk_hw *hw) > > I haven't looked at it myself yet, but would it be hard to have a > > devm_ variant of this function as well? >=20 > Seems easy enough. > Stephen is this OK with you ? >=20 > I'm just wondering if this devm_ function should use the device pointer > embedded in the clk_hw structure or have it as an argument ? >=20 > The 1st option seems simpler but I'm not sure it is correct. >=20 > Thoughts ? >=20 devm API sounds OK to me. For now we can use the one embedded in the clk_hw structure and if we have to we can replace it with the one that the caller passes in. Hopefully we never need to do that because then it means we have drivers passing around clk_hw pointers instead of having the caller use proper clk_get() style APIs.