Received: by 2002:ab2:1149:0:b0:1f3:1f8c:d0c6 with SMTP id z9csp2020466lqz; Tue, 2 Apr 2024 05:12:46 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVze02LQnQUEzq0+IBomfGAZzHYSjkajmH5d1OY3T0DP3ixsuNKu0m9G0eGxGCDKG8bbuigzUeqDktxS3Q+PG7rp+4mKXHskDQrn6goMQ== X-Google-Smtp-Source: AGHT+IGjnIZFhpZBHukJxoGNcFm3/KHfkdAgs9xa5Pr3am3/iLiPifaOMZKYUnXIj1vs6eNhu1ry X-Received: by 2002:ac8:5dce:0:b0:431:43e9:f349 with SMTP id e14-20020ac85dce000000b0043143e9f349mr14694247qtx.13.1712059966336; Tue, 02 Apr 2024 05:12:46 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712059966; cv=pass; d=google.com; s=arc-20160816; b=wcGUr7i8kxlubltIaMn4XICWxgpLcI+OqmHj9XvHd6hOkUXLurKxvCogIGmhm9fotu 9PYuWZtuHF7W8It1EkJ5rUmlAYD5JqFKfZUYndCG10tprRZTerpMNiNkPaJSsyniye7O Q2EbwIzIkUmYDaIPpWUBCzzGo/RA/jX0w9yIDCDrT1GYMYxvOX+Z4nNf1HE4kqbrMAKR /aPQY6ggoxJ0Uwjy+eOI8mqTQzYDS8W5flBuoG9qk/rxTVNoUp8zF3ZA9Sn4AeJ7JtW5 BfBJSV78DUFOJSt9xrK8L4tsSG4LeXnSLw7lVcgFDhd0hIsbsIMdqoEmrLG45MDDjxjW nXCw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :dkim-signature; bh=59+8zgH9nKJkFqI+MIO5KUM5XCs5xUxjBY89iFUie7c=; fh=NeKqXgP4eVRvMkcguUn8e8kBHlcD3Gx0X744ciuA/Mo=; b=IGiupWsA6v/E87C9ABtTjU76GvK27hcjFWcG4sdN/KMnWfHRqx/gRUV9sg6ZVN7IOq j4vy03lAkLvVUkormyEu2h4sINy56Iw0PoJLVl2DxtXsN5UnYhQZa2MHZkZh5UoAL8Qo WxBMtzVSpG5lG+X0sQWlCV9n1V3AWd6ZkgsrFdJ4UKetoeeuFe3yDE1dVOyEvJ81BW2o jwjZ3VWfTBkxMeCXKQG163FgzNY/LgKsvnMSDiPma0mNYdlbJLwnbeId6pSk8jpC2boy BnwOA+rNnCocH3aw4TT9rj1PpFAQpcAbDhfMr2bc5Nl/5ucyOZsaCgsUPuUehM1Ce2E9 UnRg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AcA7VeuH; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-127907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127907-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id m12-20020a05622a054c00b004313be34033si11519872qtx.719.2024.04.02.05.12.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Apr 2024 05:12:46 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-127907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=AcA7VeuH; arc=pass (i=1 spf=pass spfdomain=linaro.org dkim=pass dkdomain=linaro.org dmarc=pass fromdomain=linaro.org); spf=pass (google.com: domain of linux-kernel+bounces-127907-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-127907-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 8FB3D1C22A79 for ; Tue, 2 Apr 2024 12:12:26 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BA4D477623; Tue, 2 Apr 2024 12:12:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b="AcA7VeuH" Received: from mail-yb1-f171.google.com (mail-yb1-f171.google.com [209.85.219.171]) (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 408AB6A03F for ; Tue, 2 Apr 2024 12:12:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.171 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712059937; cv=none; b=NJ9Y0TNV4YTZScZGW1v/DrFmR8JJk5/FgwHRQxRqcvMNbfh5ve698w+zKf7QhC+bRZLOiV9DKH0nHKhKj6uESm3CVW8HnZlAWnk7yUA8jvnhm3g5hSuBwNvsQzi2XAtMWjz8ITmECI4vPX+kRZmpJ9uhglGQJ1Q4SffWabTIGeo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712059937; c=relaxed/simple; bh=ZU19AXGy1gTKu3ZdKgEYCn04X7EzHEkd9RdcAo9TIfw=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=FPTb9cWNeRwfVRX3d9P3igaoHazq7BhOxqAJbx6gXCQBpj+6KKpXmZQjpN8Lz/LJ256SatTEoDXdVnjBO6/UvUYAnNc5BTm+IVzA6efJJqEFWodUJF3PyjFpwukLkqnKlPvmIcNx1wXwRlzGRyfyhIAP0tIPKfEWDuJwmwikDfA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org; spf=pass smtp.mailfrom=linaro.org; dkim=pass (2048-bit key) header.d=linaro.org header.i=@linaro.org header.b=AcA7VeuH; arc=none smtp.client-ip=209.85.219.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linaro.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linaro.org Received: by mail-yb1-f171.google.com with SMTP id 3f1490d57ef6-dc745927098so4770358276.3 for ; Tue, 02 Apr 2024 05:12:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1712059935; x=1712664735; darn=vger.kernel.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=59+8zgH9nKJkFqI+MIO5KUM5XCs5xUxjBY89iFUie7c=; b=AcA7VeuH1lsru5Ic48tq2Mzw+fYeKQfYxFjlYwjbhNZqZiMZrNGnc49AfTH8KtU+0b DwDdB06Yx0nGgRNQr+uRvtwU83f8Hp8Q3YDSknC+GKmD/9yb6AB6eCA9x8viSNQueEZt uYM8BxMdZSBpD3/RlNksTZVVg7LbwVtnYBUo0fvBEt5o++7H3fmcd2+eG1yPEfDqc7T+ 1a2hctcRPBQCQPZ3M+Mo+QUefjmwhsdkQ3xpeXIZV13P9tReqlvrlhdMvX/0ta0IyCJA ipaVJnjftUGu38a9Mzynj+RSBpim/6yNCWqHBf5dNy/Y9Z+t1p63iXWoXgRy1kI0ZPin hawg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712059935; x=1712664735; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=59+8zgH9nKJkFqI+MIO5KUM5XCs5xUxjBY89iFUie7c=; b=kHdnf8TLSUnR4yLaBaqlVkx3sCpRaOGz9YVcRKhA5/Gy/yRaZ/Bu1eD/dB1nZXAHhQ QJNfNi03DN7uEFj0VGdSo5S23O0pHwPugZbt64ktPDza6lR9atKtdHYXEnyf7UBDVPVh bXY7X3xtNrNKHzVH1/bME8o7b8AozEHA6XlQ33jmeBVRmInHHCftxKMGEpxFmrDUAvVu VWXj9kXd3Fl/4xCwaCOCsdimZhR8NcbB6DyXKc77j/f8Khw9+ajNkBCWgpTjKfrXgMM8 G5sH+IOtcvmCu9MkNVqZ5/r4P+zwUoJcE+o0st2poRAlZprmM5V6H9AHDC6B3HZxckf3 OZgg== X-Forwarded-Encrypted: i=1; AJvYcCV888Un8xTE5Jm2zgB0nDtplqycjiWchiEaawBMx1UJElxQpKAYuIme58vxEVTN2bC6gJiKRR7bbPMwzoSTMrCg7P1OowgJx3gRiAPJ X-Gm-Message-State: AOJu0YwB2VBdf9D3LKeHQoIgoeyDRwQ0GT+kSa2VDsfL+Sb9gckpvrRG 7tfko0a5m1o2tw8YU18X6Slz5EfzMoAmxycH/Lyd4sVc2eiDabN4hklFIMogHLWiuEL4KvFYA70 g/ZPKqNMEfTy0efttakBoza8A6ujfXit4HJqZzA== X-Received: by 2002:a25:8590:0:b0:dcc:a5dc:e9d6 with SMTP id x16-20020a258590000000b00dcca5dce9d6mr10343762ybk.30.1712059935303; Tue, 02 Apr 2024 05:12:15 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240402103406.3638821-1-quic_varada@quicinc.com> <20240402103406.3638821-4-quic_varada@quicinc.com> In-Reply-To: From: Dmitry Baryshkov Date: Tue, 2 Apr 2024 15:12:04 +0300 Message-ID: Subject: Re: [PATCH v6 3/6] interconnect: icc-clk: Add devm_icc_clk_register To: Varadarajan Narayanan Cc: andersson@kernel.org, konrad.dybcio@linaro.org, mturquette@baylibre.com, sboyd@kernel.org, robh@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, djakov@kernel.org, quic_anusha@quicinc.com, linux-arm-msm@vger.kernel.org, linux-clk@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org Content-Type: text/plain; charset="UTF-8" On Tue, 2 Apr 2024 at 14:23, Varadarajan Narayanan wrote: > > On Tue, Apr 02, 2024 at 02:16:56PM +0300, Dmitry Baryshkov wrote: > > On Tue, 2 Apr 2024 at 14:02, Varadarajan Narayanan > > wrote: > > > > > > On Tue, Apr 02, 2024 at 01:48:08PM +0300, Dmitry Baryshkov wrote: > > > > On Tue, 2 Apr 2024 at 13:40, Dmitry Baryshkov > > > > wrote: > > > > > > > > > > On Tue, 2 Apr 2024 at 13:34, Varadarajan Narayanan > > > > > wrote: > > > > > > > > > > > > Wrap icc_clk_register to create devm_icc_clk_register to be > > > > > > able to release the resources properly. > > > > > > > > > > > > Signed-off-by: Varadarajan Narayanan > > > > > > --- > > > > > > v5: Introduced devm_icc_clk_register > > > > > > --- > > > > > > drivers/interconnect/icc-clk.c | 29 +++++++++++++++++++++++++++++ > > > > > > include/linux/interconnect-clk.h | 4 ++++ > > > > > > 2 files changed, 33 insertions(+) > > > > > > > > > > Reviewed-by: Dmitry Baryshkov > > > > > > > > Wait. Actually, > > > > > > > > Unreviewed-by: me > > > > > > > > Please return int from devm_icc_clk_register instead of returning the pointer. > > > > > > Wouldn't returning int break the general assumption that > > > devm_foo(), returns the same type as foo(). For example > > > devm_clk_hw_get_clk and clk_hw_get_clk return struct clk *? > > > > Not always. The only reason to return icc_provider was to make it > > possible to destroy it. With devres-managed function you don't have to > > do anything. > > Ok. Will change as follows > > return prov; -> return PTR_ERR_OR_ZERO(prov); > I think the code might become simpler if you first allocate the ICC provider and then just 'return devm_add_action_or_reset(dev, your_icc_clk_release, provider)' -- With best wishes Dmitry