From patchwork Wed Jul 31 12:50:53 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 11067815 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A1FA51395 for ; Wed, 31 Jul 2019 12:51:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E867284FC for ; Wed, 31 Jul 2019 12:51:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8CEC32855C; Wed, 31 Jul 2019 12:51:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5064F288D7 for ; Wed, 31 Jul 2019 12:51:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728154AbfGaMu6 (ORCPT ); Wed, 31 Jul 2019 08:50:58 -0400 Received: from michel.telenet-ops.be ([195.130.137.88]:38512 "EHLO michel.telenet-ops.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726259AbfGaMu5 (ORCPT ); Wed, 31 Jul 2019 08:50:57 -0400 Received: from ramsan ([84.194.98.4]) by michel.telenet-ops.be with bizsmtp id jQqv2000C05gfCL06Qqv77; Wed, 31 Jul 2019 14:50:55 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan with esmtp (Exim 4.90_1) (envelope-from ) id 1hso4F-0000cX-Fr; Wed, 31 Jul 2019 14:50:55 +0200 Received: from geert by rox.of.borg with local (Exim 4.90_1) (envelope-from ) id 1hso4F-0003qe-Dl; Wed, 31 Jul 2019 14:50:55 +0200 From: Geert Uytterhoeven To: Zhang Rui , Eduardo Valentin , Daniel Lezcano Cc: Marek Vasut , linux-pm@vger.kernel.org, linux-renesas-soc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] thermal: rcar_gen3_thermal: Use devm_add_action_or_reset() helper Date: Wed, 31 Jul 2019 14:50:53 +0200 Message-Id: <20190731125053.14750-1-geert+renesas@glider.be> X-Mailer: git-send-email 2.17.1 Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use the devm_add_action_or_reset() helper instead of open-coding the same operations. Signed-off-by: Geert Uytterhoeven Reviewed-by: Ulrich Hecht Reviewed-by: Niklas Söderlund --- drivers/thermal/rcar_gen3_thermal.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/drivers/thermal/rcar_gen3_thermal.c b/drivers/thermal/rcar_gen3_thermal.c index a56463308694e937..2db7e7f8baf939fd 100644 --- a/drivers/thermal/rcar_gen3_thermal.c +++ b/drivers/thermal/rcar_gen3_thermal.c @@ -443,11 +443,10 @@ static int rcar_gen3_thermal_probe(struct platform_device *pdev) if (ret) goto error_unregister; - ret = devm_add_action(dev, rcar_gen3_hwmon_action, zone); - if (ret) { - rcar_gen3_hwmon_action(zone); + ret = devm_add_action_or_reset(dev, rcar_gen3_hwmon_action, + zone); + if (ret) goto error_unregister; - } ret = of_thermal_get_ntrips(tsc->zone); if (ret < 0)