Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7153042ybi; Mon, 8 Jul 2019 15:43:12 -0700 (PDT) X-Google-Smtp-Source: APXvYqxmnAyZ4sqAFNENRcPzWwNsniF0+4Je9RY2H+AAIgILvd68fJDpfmZnurBGpfc/KJQ9Ltf8 X-Received: by 2002:a63:a1a:: with SMTP id 26mr26275204pgk.265.1562625791834; Mon, 08 Jul 2019 15:43:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562625791; cv=none; d=google.com; s=arc-20160816; b=ysHmBSaFvz0KQUuhS+SARW4xo36QY7iN6OXtjQ1PAYg9rnStyEjJfJct4d09l5rK7F pt9NPCnGeaISyveBKhhjn3tps53iIgjEIiSvraDZLrF4GcWeNdWw1Ov9dXtmz7DFzTOW O0so9ec9ZD0MfZ4IZTwPwq1HBa6pg0x/iCmd/5u9Iu5pINqPI/9uwGyapguRZzpSCPc0 52gD9MC7Dfb3OeajbEew1joQGX2WWej8DY1pWEj7IGfE7ew7MgiIgwVB3KIMu/Pfoo+M 2AytVsLqbKReX+VRPAvg3D/TdwLO/WwGR4HUJMO7Shp7Cmyy2kpQW2/buL87UF8wzVyz 02zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JjxNl+aiJVwEFW037TdFYNIV+aj3YXwaO56vKokp4fg=; b=RbX496QxaOGuxZ2AzZ3qOsPV4jPQDNTx30tYvhNTG6yICuTw3QP4ccMqwqyJT1Lgk1 YDuc0uZh5J+Vj3/NF3xAMEw/2gXTsLI04sKBeGrK7U5ubu9pWf9JoQH1QMILXpPJmgZt lAqcefhOJL4b0GTiPp7oDTcMI4A9NvVDdW5tq81mWSXHt62wbdIYLfTBUKkVB7qF8Bb6 zUomL/MPHgVqYCGu4t4cxYABOFwUf3w46aCPs5K6vdINZ1uj3/gxbR0aaAfxAnAuz7YF jFTqY0NnTeIrAPM86Uw9hSJfBFQI/yQs5cLKbK1Gb2V0ofb1FRKRQp++k/97+/wg502o vLig== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nWoMlYKC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v74si20442784pgb.375.2019.07.08.15.42.57; Mon, 08 Jul 2019 15:43:11 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=nWoMlYKC; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S2387966AbfGHQTz (ORCPT + 99 others); Mon, 8 Jul 2019 12:19:55 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:41256 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730165AbfGHQTz (ORCPT ); Mon, 8 Jul 2019 12:19:55 -0400 Received: by mail-pf1-f194.google.com with SMTP id m30so7842252pff.8 for ; Mon, 08 Jul 2019 09:19:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=JjxNl+aiJVwEFW037TdFYNIV+aj3YXwaO56vKokp4fg=; b=nWoMlYKCccZZ2MjCx59nKlI6EYqkKIeBd3VbbpagSDmMYpRzp/OD3BgiOWEYuxCbHp hshG8hoxEOe+kukeVrh4/jx/TZ68YiQ66RN87l3xj4+ZHxgfZDiyKl8IZWSvBbLTAAhf PgVHA7EibMHH0dxw6zx2gu7c5ZpZcCE2yj/5kied+vHtvPfLpLoEGJ+dTcM46zew/26S 2H7uqEwqttTzFLDDGyeaU15G3izIPwX1r4mDmI0TffWtxdrEyVFmBEpAEu+ADT4u1d9t +8FRZg7hem0ic92FEHU09XqaNFM+SsZnN9nnke+wZ7B5eTYn/uDMvQrkg5OlP8KeOdD8 CvEg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=JjxNl+aiJVwEFW037TdFYNIV+aj3YXwaO56vKokp4fg=; b=KsBLkYIzeOFiWDofZnuEJYOA9RfFKdJ9jy9yCZqdR1ToU3UMBO0q4MhbTSAnQZbP7x 9V0Y0WnV/X97HA8oIu83Ly6V9SJ58u+46L+ptXPHkQ4XDY2c/pggVsvMXgfyx1M0k6Pm G5D4PGXMNR7nLaMAGBMjvCntJkhO7e/pTa6Q+JPNSx/ZyAFtk6+hQlqRS+VXsBxK1jyl 42K1QjsvBdrU813ZoBxS3jvZElrkF7Y2ftIfFY1lVBgCBdpeTx926GO92k9XL3WOzoPB oh5GDlBj1StfYDMbyFsxhAqsuPu0FB5Cx5gP3HzcM1cpRy85WLqRnf9/btnIpY5/9rl6 3FQg== X-Gm-Message-State: APjAAAXGA+Ib5LmZOaAqGHJ8acbTbuFZTlVraJNVWZd2uP9BTfvfAY74 hyc4yEHREvsZ1klBoLhAbon+pA== X-Received: by 2002:a17:90a:fa07:: with SMTP id cm7mr26270251pjb.138.1562602794573; Mon, 08 Jul 2019 09:19:54 -0700 (PDT) Received: from builder (104-188-17-28.lightspeed.sndgca.sbcglobal.net. [104.188.17.28]) by smtp.gmail.com with ESMTPSA id h9sm4072165pgh.51.2019.07.08.09.19.53 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Mon, 08 Jul 2019 09:19:53 -0700 (PDT) Date: Mon, 8 Jul 2019 09:19:51 -0700 From: Bjorn Andersson To: Fuqian Huang Cc: Andy Gross , David Brown , Kishon Vijay Abraham I , linux-arm-msm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 12/14] phy: qcom-qmp: Replace devm_add_action() followed by failure action with devm_add_action_or_reset() Message-ID: <20190708161951.GD27383@builder> References: <20190708123401.12173-1-huangfq.daxian@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190708123401.12173-1-huangfq.daxian@gmail.com> User-Agent: Mutt/1.10.0 (2018-05-17) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon 08 Jul 05:34 PDT 2019, Fuqian Huang wrote: > devm_add_action_or_reset() is introduced as a helper function which > internally calls devm_add_action(). If devm_add_action() fails > then it will execute the action mentioned and return the error code. > This reduce source code size (avoid writing the action twice) > and reduce the likelyhood of bugs. > > Signed-off-by: Fuqian Huang Reviewed-by: Bjorn Andersson > --- > drivers/phy/qualcomm/phy-qcom-qmp.c | 4 +--- > 1 file changed, 1 insertion(+), 3 deletions(-) > > diff --git a/drivers/phy/qualcomm/phy-qcom-qmp.c b/drivers/phy/qualcomm/phy-qcom-qmp.c > index cd91b4179b10..677916f8968c 100644 > --- a/drivers/phy/qualcomm/phy-qcom-qmp.c > +++ b/drivers/phy/qualcomm/phy-qcom-qmp.c > @@ -1837,9 +1837,7 @@ static int phy_pipe_clk_register(struct qcom_qmp *qmp, struct device_node *np) > * Roll a devm action because the clock provider is the child node, but > * the child node is not actually a device. > */ > - ret = devm_add_action(qmp->dev, phy_pipe_clk_release_provider, np); > - if (ret) > - phy_pipe_clk_release_provider(np); > + ret = devm_add_action_or_reset(qmp->dev, phy_pipe_clk_release_provider, np); > > return ret; > } > -- > 2.11.0 >