Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp7477119ybi; Mon, 8 Jul 2019 22:45:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzfDXAWv+0zDXgQAoKS7+MS+1JHUZtZIavaIn51NgTlxJcp8S4Caz+HXeo+w8KedHV1b4SO X-Received: by 2002:a17:90a:f488:: with SMTP id bx8mr30278730pjb.91.1562651135968; Mon, 08 Jul 2019 22:45:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1562651135; cv=none; d=google.com; s=arc-20160816; b=Lhlx0Tq4xP7dxVhBV6h/+gXBKj3y1qZv+QcCHpivw/q5zoDjB/8U/bypg6ylwQz20y XwYAcoCg0bkFRs7PjJMjbPeeZxaLHz4nnSh4SzyqEGzE33QJOh1EOgp/IiaQ8wEAvDfv CFswMqW4A7nB9LLHqYJX55S/eMkHyCAN0qLvhX6gCkt+09my5fdzSoqOM33Ax0p++efy gFiwft9UPMKW6PZKw+h41YiHhGIPALi3w/F97lNDKb5dtwR/3jKAcOY+5bViQ5g5/bSX NYyOhP/aoF6RwJubLjj2gwvsG0Xw74lEpq3ISTcn209GeRGtQ7ldUKKHJI3QAAUDIi90 sPJg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=EqaZJyYgM0Os8ebMGdlkWjjcPY48Zl3Ke8JX40ALnsw=; b=O2Jh9NTrlru0CThFdr/ltdNi6JX76ZDSlaisSITUMEXh8trUYlAO6JBlu7ES6GArsa c2u/PPkTg9MvRnocq7z7Q1gotVlXYJpz3R6g3jNwTZlJ8WRixEdCvIbpV4/ULl8eAoHZ U6GJZXtHrer4x2p6q9Vi5qCdbZeQFU8nmSXTGE/Bz+MJOm0KflmJUNggSqsvZMFDGxo2 DzF5NGBL6AVva6b/lquu5My16ukzSZZZjVKTLIDRyk0QjaY6jIRqZl/JKUewTAXceHrL 0ZUp0yCIuTj5dqEh50K8EgqiOOC5MQGyNAHocZOoq75qLD1WbprtmC2hOOlOhbCcWWfi XIBA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=jnbG1dpq; 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 f34si20397671plf.305.2019.07.08.22.45.20; Mon, 08 Jul 2019 22:45:35 -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=jnbG1dpq; 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 S1726108AbfGIFok (ORCPT + 99 others); Tue, 9 Jul 2019 01:44:40 -0400 Received: from mail-ot1-f66.google.com ([209.85.210.66]:44483 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725832AbfGIFoj (ORCPT ); Tue, 9 Jul 2019 01:44:39 -0400 Received: by mail-ot1-f66.google.com with SMTP id b7so18642668otl.11 for ; Mon, 08 Jul 2019 22:44:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=EqaZJyYgM0Os8ebMGdlkWjjcPY48Zl3Ke8JX40ALnsw=; b=jnbG1dpqI0K+YHq/9S1CeaYEP7TPEOBIvVGhWbP/GwvHf0hUw0j7jJmO2BrWnkkr0q rTzbdUNc641u+BMwgQEzAAC35Xy0R1R3oHIE0W4okbM3zaEsBFkdzLQiSTh+JmMzpGGi umUsPNbjX7wYWsnzhnSuiCvm9txeL5ajrc6XT8gRo9J4Vj3KBidkZ6AWBzszzmDvfUnb 0I7u4pCq6i5Nz3vCPZmBuNpeOAGJO/w0ST+jsHQs/i0W7A5thVxLvEpW6KPXYYhxadVY OFFDEFCWqMgujbWTVHrfsNxLcwYXRgZaO/4dZNIyI39rQ1GpQYlBsuHMJknNLH58Cs3l pSBg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=EqaZJyYgM0Os8ebMGdlkWjjcPY48Zl3Ke8JX40ALnsw=; b=nVNXQgyTV8nuzGr1j4cCZ3BXQc5gyjtTRArm3Qo38M2Zlloaj+s7IrmE7DOR8gUSZk 77qoBMppeYHR5HZuXkDxQ8siKnN5tbjLaVYTftE2hVzEVTMtF+NvDa4QfSu3wwmMbV+O k86tHtxo1GE8FMjC2hwSDvQjiwQuvU1WLYlAmP3tUzqxxrdyGStKN4Gh9UGvM07Mf5xe SRGfHTcUGbswX41UpnDslFw3dUPTyGvbiXSs/TH885xleIJ55lrGAuLL8c7GR1jWKTNq HTrby0xCCa7ztwYWM7NB5bMNkReyGIn6xEf8PN2n4cC9VzeWJa/xOXACWAOkQbUuXCdl bCQg== X-Gm-Message-State: APjAAAUzE8pOVDOqnlHDNM+UJGnrUBlx7v3GWY+pWymCF/JFpQO97vdd n6IiWE2WcHBYQyT2D0mqX89L6REAKbfMK/M7mco+fQ== X-Received: by 2002:a05:6830:13c2:: with SMTP id e2mr15699382otq.123.1562651079043; Mon, 08 Jul 2019 22:44:39 -0700 (PDT) MIME-Version: 1.0 References: <20190708123259.11805-1-huangfq.daxian@gmail.com> In-Reply-To: <20190708123259.11805-1-huangfq.daxian@gmail.com> From: Baolin Wang Date: Tue, 9 Jul 2019 13:44:27 +0800 Message-ID: Subject: Re: [PATCH 04/14] power: supply: sc27xx: Replace devm_add_action() followed by failure action with devm_add_action_or_reset() To: Fuqian Huang Cc: Sebastian Reichel , Linux PM list , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Fuqian, On Mon, 8 Jul 2019 at 20:33, 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 Looks good to me. Thanks. Reviewed-by: Baolin Wang > --- > drivers/power/supply/sc27xx_fuel_gauge.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c > index 9c184d80088b..58b2970cd359 100644 > --- a/drivers/power/supply/sc27xx_fuel_gauge.c > +++ b/drivers/power/supply/sc27xx_fuel_gauge.c > @@ -1023,9 +1023,8 @@ static int sc27xx_fgu_probe(struct platform_device *pdev) > return ret; > } > > - ret = devm_add_action(dev, sc27xx_fgu_disable, data); > + ret = devm_add_action_or_reset(dev, sc27xx_fgu_disable, data); > if (ret) { > - sc27xx_fgu_disable(data); > dev_err(dev, "failed to add fgu disable action\n"); > return ret; > } > -- > 2.11.0 > -- Baolin Wang Best Regards