Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp1669703pxb; Fri, 22 Oct 2021 05:37:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxeyn/odMM83UJbU5SIhUkgPze/Db7IaDPQCPoTrYT4Mw7tSn3E42WGhryfeC/hhWpOlqNi X-Received: by 2002:a17:907:6e9e:: with SMTP id sh30mr14874199ejc.51.1634906269527; Fri, 22 Oct 2021 05:37:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634906269; cv=none; d=google.com; s=arc-20160816; b=OZMsEMeeOm/N5LtbPSaKX2QTejShXubqgMO8WaXGxAYEC7y8ve3oId93YH0ZTh1Chp +jbZpqywos6YJvuu7xzEe/3HYnZq/M5Ty8B1XqosGEW1TpdfmTJQl+P1+5TeEX6k2pVm yR1JPbMScbUoXVLBoH3PYyX/sxQCIbZ+bc0CwqJkebEnVA+SpowTxNZPq5LeKYf0mr2y ipa9dgmYNvSSO7sn/s/x+sBpSxf0qgH0zQCfuc59VvhBLWBn/lHmxvXbpZumcbjFHnMv Cr++w3180maBDzcPwwzJdvxFc607VaMnTfb4JgcQza9QnaZMho3zG4SuGF2vPoS8CrSI JKpQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=sJaedp+WwFniAnsPOoxdNlKqeKWuyKqfMjHYa+KV7DM=; b=omFTU4TY0TLS+nNxb/4R679wXbGGvLN2+e0d/n2sKWDJFgIXjDTw0ahrfXKAy7l8cW oVKKE1vZ98viyAloIE548ldau7vmRe1TXH66IfB5xUuIGrLebTwWpJu/Iwzz+hONRhMe Lip1ekgi22IeAmLH5mME8Bi6AEsZ8gP3xwXzDfi4qScxzfvY5ZRAY6aW2NwoUTwLZo6H 2SsMZSEKcdKNq2Vr1I9AZNoxpDOYCcJpu8SxCRaME6anj52ACXk4p8ecfZXV3nzOB1Q+ pNDNLsTWLPoSXsxUSbyAqEg9ORHeN6wx34oJA5nbWMWoW5Juz50mFdwcPZS8qFCRmgGg HN0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=psg2ERjB; 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 qf6si12963044ejc.274.2021.10.22.05.37.24; Fri, 22 Oct 2021 05:37:49 -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=20210112 header.b=psg2ERjB; 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 S231956AbhJVMhI (ORCPT + 99 others); Fri, 22 Oct 2021 08:37:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56618 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230342AbhJVMhG (ORCPT ); Fri, 22 Oct 2021 08:37:06 -0400 Received: from mail-ed1-x532.google.com (mail-ed1-x532.google.com [IPv6:2a00:1450:4864:20::532]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAF4DC061764; Fri, 22 Oct 2021 05:34:48 -0700 (PDT) Received: by mail-ed1-x532.google.com with SMTP id w19so1046771edd.2; Fri, 22 Oct 2021 05:34:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=sJaedp+WwFniAnsPOoxdNlKqeKWuyKqfMjHYa+KV7DM=; b=psg2ERjBTmguvun4iRACGpDey3AvgvUOnPmxWUCYXNVPU2Lja48yf8k+qfNAZHOwvE mdx3NZ0QRraYobiycacjFN6GrT7SLBMgp8n8Kqr/AvOabhepU1KW/RVlwhMr3BwMhdG+ p/zqmQMKhWN3xPImJkgHjc/eH9wQ5b7oURXn4dazCZpAlvpXKQAc2n4p8pJCc++RwtFl k+1IlequuJarwJ4yBYhG+DbtcgFq8+azfLBvpEO0/5QbHqJ1Jv/O6hG34TPMH1wzYs6M oEfjywrYcb0XcWD2TlkYM83WX4je/xXED6cfzrUGgUk4MS6heQk4AGP3/k/LW6FFf8sD 5cXw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=sJaedp+WwFniAnsPOoxdNlKqeKWuyKqfMjHYa+KV7DM=; b=sz2CxHbXKfshMVHzxBWLN/bmmTFzt/P58FHBVNo6vdbkF6A91ifTyYyqcp2hQ2C3Hx z+VDU8K8E6yCjaJL4YTNuvEj28WRurD4lLWeFHYbjIwkaVGFZBm+X+aYNCt1ws4vKuuN Hn91bFUezWLzbV1f0yAVdCsyROn1eVrL4W91HDXukVN7e5u4vWSrquen3DetwrzY7nAD HMbk/8Md2CHyMmLfMUDU33RAeLaa4Z1YWrmpGPRMph5wLYHDpXYJh9zSiGSgzs3jUBXx y4Y84awf2jF6xBw07EM/K9vUoysDMLGz+P8IvD7SqglInxeTciC6iLxjmigwMy0UCkZ9 swqQ== X-Gm-Message-State: AOAM530094OoWgu4RhEmFXW5O2uKXY9jph3MfqZh2LmuLriWGAwV3tm9 4OGOAcWEioy+PsfeSnwq0YVhctwV8XHDbIdKXWw= X-Received: by 2002:aa7:c0d2:: with SMTP id j18mr17043167edp.107.1634906087448; Fri, 22 Oct 2021 05:34:47 -0700 (PDT) MIME-Version: 1.0 References: <20211021174223.43310-1-kernel@esmil.dk> <20211021174223.43310-7-kernel@esmil.dk> In-Reply-To: <20211021174223.43310-7-kernel@esmil.dk> From: Andy Shevchenko Date: Fri, 22 Oct 2021 15:33:50 +0300 Message-ID: Subject: Re: [PATCH v2 06/16] clk: starfive: Add JH7100 clock generator driver To: Emil Renner Berthing Cc: linux-riscv , devicetree , linux-clk , "open list:GPIO SUBSYSTEM" , "open list:SERIAL DRIVERS" , Geert Uytterhoeven , Palmer Dabbelt , Paul Walmsley , Rob Herring , Michael Turquette , Stephen Boyd , Thomas Gleixner , Marc Zyngier , Philipp Zabel , Linus Walleij , Greg Kroah-Hartman , Daniel Lezcano , Andy Shevchenko , Jiri Slaby , Maximilian Luz , Sagar Kadam , Drew Fustini , Michael Zhu , Fu Wei , Anup Patel , Atish Patra , Matteo Croce , Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 21, 2021 at 8:43 PM Emil Renner Berthing wrote: ... > +static struct clk_hw *clk_starfive_jh7100_get(struct of_phandle_args *clkspec, void *data) > +{ > + struct clk_starfive_jh7100_priv *priv = data; > + unsigned int idx = clkspec->args[0]; > + > + if (idx >= JH7100_CLK_END) { > + dev_err(priv->dev, "invalid clock index %u\n", idx); > + return ERR_PTR(-EINVAL); After this https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core.git/commit/?h=driver-core-next&id=7065f92255bb2468dbb9aa0537ff186ef64d5a02 It's okay to use > + } if (idx >= JH7100_CLK_END) return dev_err_probe(priv->dev, -EINVAL, "invalid clock index %u\n", idx); Ditto for other similar cases. > + if (idx >= JH7100_CLK_PLL0_OUT) > + return priv->pll[idx - JH7100_CLK_PLL0_OUT]; > + > + return &priv->reg[idx].hw; > +} ... > + while (idx) > + clk_hw_unregister(&priv->reg[--idx].hw); I still consider that usual pattern, i.e. while (idx--) clk_hw_unregister(&priv->reg[idx].hw); but since you are pushing hard for your variant I'll leave it to the maintainers and author. -- With Best Regards, Andy Shevchenko