Received: by 2002:a25:c593:0:0:0:0:0 with SMTP id v141csp977755ybe; Mon, 2 Sep 2019 12:13:00 -0700 (PDT) X-Google-Smtp-Source: APXvYqyxDQYgAK5L9E4KPjiHjjw04sOjDLOzfVK0riYqU4kH5UYpIWcVqXu73reR+fOMwz5Nw33E X-Received: by 2002:a63:d301:: with SMTP id b1mr26125471pgg.379.1567451579891; Mon, 02 Sep 2019 12:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1567451579; cv=none; d=google.com; s=arc-20160816; b=KoqvHU5SKjwIUrL2QH2YME7K+fkzHcBCZ+4OIUejtC+CL2lWb/120fHLiicyCMCOy9 TrClLug3g7o3goSE61sXuea+VQuCekAu7sicU1vF8NeU92ARXujQv22k73NWmw9vHXHu 2vIf999AjJ9Jhm3Gj5B2UFLn/RftFrtQCF8Ra9dXEnptHNa7ETnz+5GYn0IKNCkNkwZs 87n34B4mz/Kr6V+X95MXYLbhbrA9DyBxLtV19oUftoGxz26ci5vQQNExFqPa93URuyM5 TNqbudt+QjtegMMEOmCUs/G1HoYq5pVwgGX77D9JiGELUIfjPt/gb+2iX9tiHMc02dIN 42CQ== 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=oWTYT2NLVeWnjC+HwTVcRPzmAnt1RlZJZ+xb+UzrND4=; b=EpwvIqHBFW7PkWjEesIiKZSIolCUEgpD++gRvjx+EFCvIiYaPAmE8XYpWp+SKQ8hXW lKbf3XInA3FMSdK8DOsI5CGuDrn2pYHb9l3IDlEg751jn02EyNJEyC33nOARF+Jzb3qY zXj0OKr5bGgADFKQLtcrY78z6txHKIfk96Y8bm3SD7qfY/5IUtxTW9mcwAkBhSdTUQsg +x+rfGyjH/LYOOrKKIpYiPGX3Nz9dWtzafi8bOSdQNvN4ro0zxenU2Qt2Bdwtuu5R4e0 pUIOr1voxFhiWRac0hRQwR7eE5z2Uxp4Zxd5EK/Xi9E5ZSgheIRDVjwgNyQCTWZx+0Uw oNDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Yy1Bfhx5; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a19si12607900pgv.180.2019.09.02.12.12.44; Mon, 02 Sep 2019 12:12:59 -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=@kernel.org header.s=default header.b=Yy1Bfhx5; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727111AbfIBTKl (ORCPT + 99 others); Mon, 2 Sep 2019 15:10:41 -0400 Received: from mail.kernel.org ([198.145.29.99]:39846 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726750AbfIBTKl (ORCPT ); Mon, 2 Sep 2019 15:10:41 -0400 Received: from earth.universe (unknown [185.62.205.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 286D021881; Mon, 2 Sep 2019 19:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1567451440; bh=o6TcG03YBUB4jhK8VmhqyfAVlClgI8++mjZPPQ7PPEA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Yy1Bfhx5i1y36CLDTFjYmL11+cZygxG8NsTihXVcBSUkZMDPeYvxtbETzjFZEpAzW fHH1heLaABKOgvVRjZUcMc/dNRwmvJDkHBKkgxIiRmMgzFgGHKh5AKGQ63Sy+/XLYu SglACDPpwCarrRLBBbCKdxSRjc7/VyQkWF684Q3Q= Received: by earth.universe (Postfix, from userid 1000) id EDFD33C0B7F; Mon, 2 Sep 2019 21:10:37 +0200 (CEST) Date: Mon, 2 Sep 2019 21:10:37 +0200 From: Sebastian Reichel To: Fuqian Huang Cc: linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 04/14] power: supply: sc27xx: Replace devm_add_action() followed by failure action with devm_add_action_or_reset() Message-ID: <20190902191037.hjm7ppaq5npkkkur@earth.universe> References: <20190708123259.11805-1-huangfq.daxian@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6wqikcdinrumvx6s" Content-Disposition: inline In-Reply-To: <20190708123259.11805-1-huangfq.daxian@gmail.com> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --6wqikcdinrumvx6s Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Mon, Jul 08, 2019 at 08:32:59PM +0800, Fuqian Huang wrote: > devm_add_action_or_reset() is introduced as a helper function which=20 > internally calls devm_add_action(). If devm_add_action() fails=20 > then it will execute the action mentioned and return the error code. > This reduce source code size (avoid writing the action twice)=20 > and reduce the likelyhood of bugs. >=20 > Signed-off-by: Fuqian Huang > --- Thanks, queued. -- Sebastian > drivers/power/supply/sc27xx_fuel_gauge.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) >=20 > diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/sup= ply/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; > } > =20 > - ret =3D devm_add_action(dev, sc27xx_fgu_disable, data); > + ret =3D 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; > } > --=20 > 2.11.0 >=20 --6wqikcdinrumvx6s Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAl1taS0ACgkQ2O7X88g7 +ppo/A//cxsiIU6totIzi1b9EtpeLb9zEQ4r47Vyly8/sMjlhpos3AGI4oaaGI95 bM7WnmcRthxxkPiw6CGfza9JyzfFPi0Fl5iO5788FEwdXnRvvRvzj6EuD0+4O41e u4Avr+rqbGpKpweH7IIpBlfhEk7zDimZ0IooLJ9Seglmsg2eRKNQBywHeR/MbPC5 aBLW7krRs7JdEz3Ast5UescipE0oqVXEZME4Yw4/DQxn+yoQkcH/8En0duJql3bu Io8tvxYmNlR8USSoWN6GGwavjCYpu43tdkWj+y3XaPSJ5jCTrXPzJ3ny1HDKy2Ee 6s6/6cMzcuOaySfj0n+0L8ZXM1FHb66LQbYwFJgdvHciS1RlI3df/QFb5Fz0dxPn YRIhcLL7PYHLvZHvJb2Ff9X8sZ+dN0FginFCycUMbUxQgJwZ32mCBzG9NchcJMjT 3V6+exXwYgdQwMTxKDXKs/FG6S1gVCGFYyQr4U/vDULuoWLVRkf44dDPZV7jiiA3 TwyCWfkYgiJ3/VL65N8dPIK53pyEbmkvydQoZxIrr9dEitaYYkM5FR98V7rOzSeM H28lhVZAvFHMa9AGLhlBeB6n1UWWeILzf6CIQKRmEnYFM0Q7bS65Inh+Zc6NUTlF j615QU9+5pHRxZrR1Hd66ZwIF1BSE5AmbP3TzqoumMz441Jj85A= =ZkWD -----END PGP SIGNATURE----- --6wqikcdinrumvx6s--