Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp9937720imu; Wed, 5 Dec 2018 12:58:57 -0800 (PST) X-Google-Smtp-Source: AFSGD/WoshoRbLDz7zAkbLPUCIcPLjI+p4RZa805Bn3/aTJOK0+NKEgof55U+HRsmqcS7CArqiZy X-Received: by 2002:a62:2f06:: with SMTP id v6mr26268797pfv.216.1544043537311; Wed, 05 Dec 2018 12:58:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544043537; cv=none; d=google.com; s=arc-20160816; b=g0A4Lk3gveDBLASojAqyS/Rd+kQvLkhgy9my67eIt8AyuzLdAjQYFuEj1T4UrliQlA gpQX0KoSSINgrX7yTznHkh430q3IyNpx/VRpTaMX0aP9E86t7iq8JSgD9n9n8YtZ6qqU wl4uUALb02GU8sYvs5epredvyOU2+qd7khBDK59gL5SfZBgxyKx/Msz+kf9aFLror68K 9PKODlbeONOJYBQEm1clW1NTuywuSsU/mIyLbItfH3/7Wci4Uw0gWVP1pIObEK4BG2dK jA+0QghGMaBQN+1UNn6Mj1RWAKY19GbohtWa6YjQlZ438VZ4W2rYNavkUr7TsTAqTmZ1 xIvQ== 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; bh=td7gDbUAp4t1F6KxDt/ImdZYp8BGjfXfwBTNOQcPJrA=; b=qOvtXD3/x8/mw18ZosKP7V1PpxwUU33zM/oBnEN9XiEIy3a9/gb2PuqrxCnl+jagG9 sW2h+UoyB1+cjIahobixxt2PusOvsjPPqk9P9rEH5IsBV4DbXmi4hnCRAjMBJoSMAoUx jl8xWiEDKXXDD9p4fPG9r8Sqw125dpPtoVRgClkrnHpgkKOJHJNkP9EWLsIWjcJRfVo9 LKAVszAh67a8BLWF5QPZNdJO1fsJ50Q9Uncx39EAHulEdidY8y0wazU28IgNa1h9rtzI oxvlCjfgOvIVKrdg+tW0YjsDAJnRpCHGBxn4tqDj+o5yWMXznwTxr1wVwGfUEpNheKtF 3Oog== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 3si21311669pla.240.2018.12.05.12.58.42; Wed, 05 Dec 2018 12:58:57 -0800 (PST) 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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728500AbeLEU6G (ORCPT + 99 others); Wed, 5 Dec 2018 15:58:06 -0500 Received: from bhuna.collabora.co.uk ([46.235.227.227]:51206 "EHLO bhuna.collabora.co.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727679AbeLEU6F (ORCPT ); Wed, 5 Dec 2018 15:58:05 -0500 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: sre) with ESMTPSA id 5CB602761E0 Received: by earth.universe (Postfix, from userid 1000) id 6002D3C08D6; Wed, 5 Dec 2018 21:58:00 +0100 (CET) Date: Wed, 5 Dec 2018 21:58:00 +0100 From: Sebastian Reichel To: Lubomir Rintel Cc: Mark Brown , Geert Uytterhoeven , Darren Hart , Andy Shevchenko , Greg Kroah-Hartman , James Cameron , Rob Herring , Mark Rutland , Eric Miao , Haojian Zhuang , Daniel Mack , Robert Jarzmik , linux-spi@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, platform-driver-x86@vger.kernel.org, devel@driverdev.osuosl.org, linux-pm@vger.kernel.org Subject: Re: [PATCH v2 15/17] power: supply: olpc_battery: Use devm_power_supply_register() Message-ID: <20181205205800.dqg3airnnvmzduyl@earth.universe> References: <20181116162403.49854-1-lkundrak@v3.sk> <20181116162403.49854-16-lkundrak@v3.sk> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="2zavjpobxxrb6mg6" Content-Disposition: inline In-Reply-To: <20181116162403.49854-16-lkundrak@v3.sk> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --2zavjpobxxrb6mg6 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi, On Fri, Nov 16, 2018 at 05:24:01PM +0100, Lubomir Rintel wrote: > This simplifies the error handling. >=20 > Signed-off-by: Lubomir Rintel >=20 > --- Reviewed-by: Sebastian Reichel -- Sebastian > Changes since v1: > - This was split off the "power: supply: olpc_battery: Move priv data to > a struct" patch. >=20 > drivers/power/supply/olpc_battery.c | 19 +++++-------------- > 1 file changed, 5 insertions(+), 14 deletions(-) >=20 > diff --git a/drivers/power/supply/olpc_battery.c b/drivers/power/supply/o= lpc_battery.c > index b091f897c1d4..4433eb10a23d 100644 > --- a/drivers/power/supply/olpc_battery.c > +++ b/drivers/power/supply/olpc_battery.c > @@ -628,7 +628,7 @@ static int olpc_battery_probe(struct platform_device = *pdev) > psy_cfg.of_node =3D pdev->dev.of_node; > psy_cfg.drv_data =3D data; > =20 > - data->olpc_ac =3D power_supply_register(&pdev->dev, &olpc_ac_desc, &psy= _cfg); > + data->olpc_ac =3D devm_power_supply_register(&pdev->dev, &olpc_ac_desc,= &psy_cfg); > if (IS_ERR(data->olpc_ac)) > return PTR_ERR(data->olpc_ac); > =20 > @@ -643,15 +643,13 @@ static int olpc_battery_probe(struct platform_devic= e *pdev) > olpc_bat_desc.num_properties =3D ARRAY_SIZE(olpc_xo1_bat_props); > } > =20 > - data->olpc_bat =3D power_supply_register(&pdev->dev, &olpc_bat_desc, &p= sy_cfg); > - if (IS_ERR(olpc_bat)) { > - ret =3D PTR_ERR(olpc_bat); > - goto battery_failed; > - } > + data->olpc_bat =3D devm_power_supply_register(&pdev->dev, &olpc_bat_des= c, &psy_cfg); > + if (IS_ERR(data->olpc_bat)) > + return PTR_ERR(data->olpc_bat); > =20 > ret =3D device_create_bin_file(&data->olpc_bat->dev, &olpc_bat_eeprom); > if (ret) > - goto eeprom_failed; > + return ret; > =20 > ret =3D device_create_file(&data->olpc_bat->dev, &olpc_bat_error); > if (ret) > @@ -666,10 +664,6 @@ static int olpc_battery_probe(struct platform_device= *pdev) > =20 > error_failed: > device_remove_bin_file(&data->olpc_bat->dev, &olpc_bat_eeprom); > -eeprom_failed: > - power_supply_unregister(data->olpc_bat); > -battery_failed: > - power_supply_unregister(data->olpc_ac); > return ret; > } > =20 > @@ -679,9 +673,6 @@ static int olpc_battery_remove(struct platform_device= *pdev) > =20 > device_remove_file(&data->olpc_bat->dev, &olpc_bat_error); > device_remove_bin_file(&data->olpc_bat->dev, &olpc_bat_eeprom); > - power_supply_unregister(data->olpc_bat); > - power_supply_unregister(data->olpc_ac); > - > return 0; > } > =20 > --=20 > 2.19.1 >=20 --2zavjpobxxrb6mg6 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCgAdFiEE72YNB0Y/i3JqeVQT2O7X88g7+poFAlwIO9gACgkQ2O7X88g7 +prfpw//V7/f7zADi/0A0e8qUovcWhycMk5Q3l+O8pwziULaZUUJb9zoF0JARKDn Ie5a2ib+nJLBADkOvh7GXka5tvVPgn1K1CC65Sdddm7a31b2qlts+oo5yJcDoyq7 G9SRctk19Oo/u1QR2MQ1yyfWSxd0si0oXVGJQC/cMz69rY/hSoBCH3kq0PtQiYMv jN+7KJEAsi1gOZrlIm0MBcbRqumSywm0DVbD9Yjlwptja8Fgo1qT65zx9uErpZ2U zHR0wiJ5LafnzbgJGFBQ0Tn8prtBwL9yg6KykKYbsqrFCqeu+KJuWOPOza/GMU8g acvNFAI4chNTr5WZ2R/21yz+NybUekzo0DFyttjGATrDYJR6qVyXaMMxv5q8U67I uF1wgktQ4wI8aIPJ2+/CDev32H1FOdndmfh7j9Kh3BVXd1QBmQKbEB1lMNhxFU4V rqz9pQi5Q6Q/YylDSmnllSGN4Vj6rrwx2yOkG09BZIVBJC0xLiv99CGnpb44tELb GdWo0bM92jbi9xhk6wxs5Ji+sZA0FqLfRFFGYR8W1bHFoKpofchTXD7mzyoBMqnr SHvoVlHrQ/zVB8JG8lEmUyKv3LQZkzaCAPO/27W4GXSlUpiVY1qmxExR2wiHcXDB xj7qvKbm8WTB0jBmG3Hc9juVRl64mXkn36eB1vxeC1+RQVQxp+U= =pGoN -----END PGP SIGNATURE----- --2zavjpobxxrb6mg6--