From patchwork Wed Nov 25 08:29:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wang Li X-Patchwork-Id: 333428 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 77EB2C56201 for ; Wed, 25 Nov 2020 08:26:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 19F44208CA for ; Wed, 25 Nov 2020 08:26:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726828AbgKYI0n (ORCPT ); Wed, 25 Nov 2020 03:26:43 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:7680 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726754AbgKYI0n (ORCPT ); Wed, 25 Nov 2020 03:26:43 -0500 Received: from DGGEMS403-HUB.china.huawei.com (unknown [172.30.72.59]) by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4Cgv9m5J5xz15KLY; Wed, 25 Nov 2020 16:26:20 +0800 (CST) Received: from huawei.com (10.175.127.227) by DGGEMS403-HUB.china.huawei.com (10.3.19.203) with Microsoft SMTP Server id 14.3.487.0; Wed, 25 Nov 2020 16:26:31 +0800 From: Wang Li To: , , CC: , Subject: [PATCH v2] watchdog: rti-wdt: disable runtime pm in case of failure Date: Wed, 25 Nov 2020 16:29:56 +0800 Message-ID: <20201125082956.3325066-1-wangli74@huawei.com> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 X-Originating-IP: [10.175.127.227] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org In case of runtime pm failed, should disable runtime pm. Fixes: 2d63908bdbfb ("watchdog: Add K3 RTI watchdog support") Reported-by: Hulk Robot Signed-off-by: Wang Li --- Changelog: v2 - Change the fix tag. --- drivers/watchdog/rti_wdt.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/watchdog/rti_wdt.c b/drivers/watchdog/rti_wdt.c index 836319cbaca9..8885841eef4f 100644 --- a/drivers/watchdog/rti_wdt.c +++ b/drivers/watchdog/rti_wdt.c @@ -227,8 +227,10 @@ static int rti_wdt_probe(struct platform_device *pdev) pm_runtime_enable(dev); ret = pm_runtime_get_sync(dev); - if (ret) - return dev_err_probe(dev, ret, "runtime pm failed\n"); + if (ret) { + ret = dev_err_probe(dev, ret, "runtime pm failed\n"); + goto err_iomap; + } platform_set_drvdata(pdev, wdt);