Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp3197605pxb; Mon, 18 Oct 2021 10:05:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxiirMtnNg6bwMHQaiVcWFwUkdOOjEdq64JhjFT36SjQCNpx6/lgsA7a56olzo9RK1rsFsd X-Received: by 2002:a17:906:4482:: with SMTP id y2mr31377510ejo.484.1634576710212; Mon, 18 Oct 2021 10:05:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1634576710; cv=none; d=google.com; s=arc-20160816; b=TX3TUCQjANVdAbH4U8+Bs8bS2Fyd3xziJwjbn1G8VBOgMpJABjTY3cwgD00k0EvoGq 4Cfdgw+e6ejUb6is7zU6rOYEKyLBw172jIiNXAA6LYtM3e1H0EAfysT6isFG23dNjqUj GYstbHtMCKZX74QClZv4xKLHJq8rihBFCK2qBExb7Oj2tkXAFt/3sqZidQocg2O+iSvK 52E20pVqpxA20XIlfDtZVVRKL0p73XOqJtMdm64ewKyVBZb8RTjumJ9PtVSgDw4ZfqaY P2J3LL3Etvwg9866kIgG8+Ms1PocLXBM3vrPWUgXq2hUtVmjPGCNgLwcV1xry73umKL/ Ingw== 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; bh=pncH/JsFyTOuX1MFN8WrmdDdgAe+iOiHDqyec0cvtsI=; b=UHKzyf3Rjp6zp4AnKgMBG7023UZF4z+nuK0cao8wJEMyPvXsFVvpHRPgJtlsHLi8aD NWhzVWr8rC3RU4sUc3xz49VByu9E4Ro9no9tgQeqwrzpePwkOb0usVM6kzsKINta2bvY DYRONVJisslOU7mb5tBEl0LmSnG7mxIiI2Hf8yT5eKcfCNMzeWmOHCLGrV+6p5zKkNBm 7b6WfmqYT8HmMfUjePSaXC62QKR3Xz9XfkpfO89O1WVmRINgS8Bdw1mmVg+dFqvNw/MH OF5hdAj3rhCH9ZsbMfKnhRe3kXS0G4ubzYKXiSrbPzY0iyeObXEW6Ni03e2X5xp3B7Mv QyDg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m10si20238290ejb.115.2021.10.18.10.04.46; Mon, 18 Oct 2021 10:05:10 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232954AbhJRRFH (ORCPT + 99 others); Mon, 18 Oct 2021 13:05:07 -0400 Received: from mail-pf1-f173.google.com ([209.85.210.173]:41893 "EHLO mail-pf1-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232114AbhJRRFG (ORCPT ); Mon, 18 Oct 2021 13:05:06 -0400 Received: by mail-pf1-f173.google.com with SMTP id y7so15192543pfg.8; Mon, 18 Oct 2021 10:02:55 -0700 (PDT) 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=pncH/JsFyTOuX1MFN8WrmdDdgAe+iOiHDqyec0cvtsI=; b=jpI6zqbUv5bYjw+0TiJ9PcQLG5GIjIweGDTDknk6tm4ga9WwBQ6AVdYIe0ISeWfDF4 NoocRpl43EqLFWRNtbTnK3vK9YR86tICdCPUuKYNhSi1Wxke8ZpjrFa1ARcE701irSM/ aIE7O1rpZj65bgpwdC2QZebC6ZrZ0DNsr+xJFW5NV0Ac2fTkcQhjf8Yd40grYxRvNCuB zA0Hb4+e3x17ubmSdScf+Y2g4THsbAc2R2EQN9M0mXFArGqBXKNWMM/CT3uYAMTpKLGa YgdDteTV144E4JNJo0m4rsOef9metjGU2dbD27gYF4w+MZm/CbLOdgnmSOZ26aoUDD0G RP5g== X-Gm-Message-State: AOAM530tzxhnQriLZip/hq4OAOqOXE1gw+TiOWFY4GjnqRPYtR0UxDHF 8PV1K/7je9Z2mvoCSNQxGf87V1go/kFlSTIfUlLUDY+pIn0= X-Received: by 2002:a05:6a00:1707:b0:44d:47e1:9ffe with SMTP id h7-20020a056a00170700b0044d47e19ffemr30112553pfc.53.1634576575002; Mon, 18 Oct 2021 10:02:55 -0700 (PDT) MIME-Version: 1.0 References: <20211012134027.684712-1-kernel@esmil.dk> <20211012134027.684712-13-kernel@esmil.dk> In-Reply-To: From: Emil Renner Berthing Date: Mon, 18 Oct 2021 19:02:43 +0200 Message-ID: Subject: Re: [PATCH v1 12/16] pinctrl: starfive: Add pinctrl driver for StarFive SoCs To: Andy Shevchenko Cc: linux-riscv , devicetree , linux-clk , "open list:GPIO SUBSYSTEM" , "open list:SERIAL DRIVERS" , 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 , Geert Uytterhoeven , Anup Patel , Atish Patra , Matteo Croce , Linux Kernel Mailing List , Huan Feng Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 18 Oct 2021 at 18:29, Andy Shevchenko wrote: > On Mon, Oct 18, 2021 at 7:23 PM Andy Shevchenko > wrote: > > On Mon, Oct 18, 2021 at 6:56 PM Emil Renner Berthing wrote: > > > On Mon, 18 Oct 2021 at 17:48, Andy Shevchenko wrote: > > > > On Mon, Oct 18, 2021 at 6:35 PM Emil Renner Berthing wrote: > > > > > On Tue, 12 Oct 2021 at 19:03, Andy Shevchenko wrote: > > > > > > On Tue, Oct 12, 2021 at 4:43 PM Emil Renner Berthing wrote: > > ... > > > > > > > > + ret = clk_prepare_enable(clk); > > > > > > > + if (ret) { > > > > > > > > > > > > > + reset_control_deassert(rst); > > > > > > > > > > > > Use devm_add_action_or_reset(). > > > > > > > > > > I don't see how that is better. > > > > > > > > Pity. The rule of thumb is to either try to use devm_*() everywhere in > > > > the probe, or don't use it at all. Above is the more-or-less standard > > > > pattern where devn_add_action_or_reset() is being used in the entire > > > > kernel. > > > > > > > > > Then I'd first need to call that and > > > > > check for errors, but just on the line below enabling the clock the > > > > > reset line is deasserted anyway, so then the action isn't needed any > > > > > longer. So that 3 lines of code for devm_add_action_or_reset + > > > > > lingering unneeded action or code to remove it again vs. just the line > > > > > above. > > > > > > > > Then don't use devm_*() at all. What's the point? > > > > > > I'm confused. So you wan't an unneeded action to linger because the > > > probe function temporarily asserts reset for 3 lines of code? > > > > I;m talking about clk_prepare_enable(). > > Having a second look I found even problematic error paths because of > mixing devm_*() with non-devm_*() calls, which only assures me that > your ->probe() error path is broken and should be revisited. So do you want to expand on that now or should I send v2 first?