Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp13594848rwd; Sat, 24 Jun 2023 03:14:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ535Lzpz6bjRyTBAEoFKdXls2T9NXpu62wSLNXGlMdR5NKEBqQDuDDfLH/Eiya5m5e6WKiC X-Received: by 2002:a17:90b:3001:b0:260:c51e:ba51 with SMTP id hg1-20020a17090b300100b00260c51eba51mr19128569pjb.11.1687601662235; Sat, 24 Jun 2023 03:14:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687601662; cv=none; d=google.com; s=arc-20160816; b=UAWzJl69fM4QDDBtjdrOSuB2JFIZzhVW7qSfdD5NeBl47qtjitFpcdiALmmCyyj734 dD1osUfgd6qHNwilbn+b64Q87OLx93yKREzRVOwq48SxIozJ0P/rjxPvwmavyIuaYxh1 rEM6QgikbAnDdcP6f+w5Lz2crx2pNZjBS5L9jhJiUUa5r3bEGNKkUQdSthXCFYC+ZxJV LCuC3w85yQbL0Xz1+VluhEL9hYfCzOAnkSr7NiZBbzTica6JjeXuWfUIkF2SjJtHdnb+ tr7tZk+eQJ3GKFthiujWKrICxviJvjj24lyOIoF5zbcG8fQbB8rpZZ8gfUgr6r9pQ1kI basg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:references :cc:to:from:content-language:subject:user-agent:mime-version:date :message-id:dkim-signature; bh=QoNtG/v3rSRDZ59/+rWTCWbhHlO7e/ovNSLpKbH5pNc=; fh=iWPLepIyqUYxsyZ8fYdi/zfxDcrp5tqbIPu4LeKW9Fc=; b=J3Z32q4H+/4ihYudMdlWoyibrd7geSGxNCucH58kv88SSK43dKA5jPkVj4l1TbQ/t5 fSQlzWV8quSRhv4RbRWkS57cIZB5tr36mF8c7/UIWVnslccJwxKcOHllVddZmEdwbWkT 34YkNYIvaIL9JvwkiQqScEpdW+54UCv7o2tYJGt7f/lKjfHwLMLIxBR87YYFRgnZcq+W Zve7Zs8hXMdjskuoagYHFPaU5+i0YHgIdjbs0qF51KX1ooCsueuoXcNUCCAdeLttacyq qf78qxS9ez2ORR4eKwv9wZgYdSoAiim9qW09RMPCC2D/F6ZZNMu7V3tbrAjR+s+GIpcB FasQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m8AOR415; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x13-20020a17090aca0d00b00262c7b59f4esi971575pjt.188.2023.06.24.03.14.09; Sat, 24 Jun 2023 03:14:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m8AOR415; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233038AbjFXKBn (ORCPT + 99 others); Sat, 24 Jun 2023 06:01:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230385AbjFXKBj (ORCPT ); Sat, 24 Jun 2023 06:01:39 -0400 Received: from mail-ej1-x632.google.com (mail-ej1-x632.google.com [IPv6:2a00:1450:4864:20::632]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 27564E41 for ; Sat, 24 Jun 2023 03:01:37 -0700 (PDT) Received: by mail-ej1-x632.google.com with SMTP id a640c23a62f3a-988a2715b8cso475693066b.0 for ; Sat, 24 Jun 2023 03:01:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1687600895; x=1690192895; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QoNtG/v3rSRDZ59/+rWTCWbhHlO7e/ovNSLpKbH5pNc=; b=m8AOR415JnoiVvUV0Hgcuqn8vZN1s7R8ygno813ELvu/3g+Nk/lO5eDNL10lOYui2F DEsWcq3+4mMALwPmsYjgok7nGDROv9C3IpIvNvoledT80kT6MIB1SEzvhOwJ/Zj7oIwO iF5KlQ89AfdeWx2ZIWzYdNVSxwDo9EU/9m94P8kHmaBWpkTvWL3hidjAXPUjzNqO7fB/ wNBXx+ZPHQDcCncqz1nEPNysSTeCwkjjbnMhQMpj2qWHM09VuJswSbBqnK7i5G4n0ChB l8gIRK019sBaCXw7Q77Fvm6VT4pPA7Tf/7Fnv6J5j6S517Kb4m2stzUXJQEE1R2jzf5r h4iw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1687600895; x=1690192895; h=content-transfer-encoding:in-reply-to:references:cc:to:from :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QoNtG/v3rSRDZ59/+rWTCWbhHlO7e/ovNSLpKbH5pNc=; b=GD2aFgQjb3Gv+aw4FV4KsJ6x92obzn6FayBnpsKQxpqqprGe4zQxrOSGCVAoxXkwFs Om4d+wclxYCBMThhE2sNb+LbdwfWGeRi8kT3DZIJ89kMI5E0P4I17StO7UbL8MDkXDWY GJEC3M8EdjmF7MrxSGvIRc6l2KwVN5DuOBLfYOyb9ZAct4ZA13q+oY+KKEPogi9Q1wp3 ROnPNvW3aWpacwRUheXroZOBFgBm3jHKJznQRVSFa6T0NtCPz7j/MrfeFtCSYtHJ4aGk +Vnwkv5azfke80rN4oGH8XE1PscPyH2o/rq2mxaPxPxsbOkOOegO2bezUGqrM56y7B14 7vYA== X-Gm-Message-State: AC+VfDw6pKcSUC3E15IXRTlERQk1gaXE3BJhjjRR7X+amCdp7c/Nsx2X xE2fOUVG0UxOUD62bot4zbKLKg== X-Received: by 2002:a17:907:2da6:b0:988:15f4:fdba with SMTP id gt38-20020a1709072da600b0098815f4fdbamr20482429ejc.14.1687600895515; Sat, 24 Jun 2023 03:01:35 -0700 (PDT) Received: from [192.168.1.20] ([178.197.219.26]) by smtp.gmail.com with ESMTPSA id mc3-20020a170906eb4300b00988cb67ee1asm717534ejb.55.2023.06.24.03.01.33 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 24 Jun 2023 03:01:35 -0700 (PDT) Message-ID: <3272350f-73fc-f6b6-326f-1b9d7db75758@linaro.org> Date: Sat, 24 Jun 2023 12:01:32 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.12.0 Subject: Re: [PATCH 3/7] soc: qcom: add QCOM PBS driver Content-Language: en-US From: Krzysztof Kozlowski To: Anjelique Melendez , pavel@ucw.cz, lee@kernel.org, thierry.reding@gmail.com, robh+dt@kernel.org, krzysztof.kozlowski+dt@linaro.org, conor+dt@kernel.org, agross@kernel.org, andersson@kernel.org Cc: konrad.dybcio@linaro.org, u.kleine-koenig@pengutronix.de, linux-leds@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-msm@vger.kernel.org, linux-pwm@vger.kernel.org, Abel Vesa References: <20230621185949.2068-1-quic_amelende@quicinc.com> <20230621185949.2068-4-quic_amelende@quicinc.com> <42126265-75b6-83be-c3aa-ee2a16cb26dd@linaro.org> In-Reply-To: <42126265-75b6-83be-c3aa-ee2a16cb26dd@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 24/06/2023 11:55, Krzysztof Kozlowski wrote: >> +/** >> + * get_pbs_client_device() - Get the PBS device used by client >> + * @dev: Client device >> + * >> + * This function is used to get the PBS device that is being >> + * used by the client. >> + * >> + * Returns: pbs_dev on success, ERR_PTR on failure >> + */ >> +struct pbs_dev *get_pbs_client_device(struct device *dev) >> +{ >> + struct device_node *pbs_dev_node; >> + struct pbs_dev *pbs; >> + >> + pbs_dev_node = of_parse_phandle(dev->of_node, "qcom,pbs-client", 0); >> + if (!pbs_dev_node) { >> + pr_err("Missing qcom,pbs-client property\n"); >> + return ERR_PTR(-ENODEV); >> + } >> + >> + mutex_lock(&pbs_list_lock); >> + list_for_each_entry(pbs, &pbs_dev_list, link) { > > It does not make sense. You have the reference to the device, so you > have the pbs (via container_of). Don't add some > global-list-lookup-functions. > > Look for example at Abel Vesa's ICE patchset. To be specific: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/soc/qcom/ice.c?h=v6.4-rc7#n293 (+CC Abel) Best regards, Krzysztof