From patchwork Fri Jan 24 09:28:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 232830 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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, USER_AGENT_GIT autolearn=unavailable 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 B6DDDC2D0DB for ; Fri, 24 Jan 2020 11:41:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 8E818206F0 for ; Fri, 24 Jan 2020 11:41:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579866085; bh=bFdSWV6KGot4Ftog2vGlmBdgbfDjbkKx2e5oo65z+lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=sDfH4k1aXGFuVuhVmOkdIwDJOKNMRxokHHVJ+QSCD3gJ88r1nH7LP4Du7ZxxOTuBV XYpJmPL2B/uenffzIHzAsYMIEo2ZIRnd2By9A0gfVr1e7iyEXWoM5IfuMVGvjYMXfe M0H/Wj+Vlmg1vpOZeRWs8JFcwoEC+gnfR9dE6UeI= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390714AbgAXLSx (ORCPT ); Fri, 24 Jan 2020 06:18:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:56180 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390498AbgAXLSw (ORCPT ); Fri, 24 Jan 2020 06:18:52 -0500 Received: from localhost (ip-213-127-102-57.ip.prioritytelecom.net [213.127.102.57]) (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 6829E20704; Fri, 24 Jan 2020 11:18:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579864732; bh=bFdSWV6KGot4Ftog2vGlmBdgbfDjbkKx2e5oo65z+lo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Mq+XFsBZgjkDn+MQn1/sECqYT7gXaTiz3qkEkiQTujcOgR1TbRUcizL4eYJ7iC5oy vwFhhT0LaM+6qCV0FbuDSdiyqJaLc8BJdT0nQO3HqHzfQi+jqIN666Z8pUi8laiqqp mlGCJ3esiJjpRkyhKqFMCjeEcSbtuIoKRDpatYpY= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, =?utf-8?q?Andreas_F=C3=A4rber?= , Guenter Roeck , Wim Van Sebroeck , Sasha Levin Subject: [PATCH 4.19 350/639] watchdog: rtd119x_wdt: Fix remove function Date: Fri, 24 Jan 2020 10:28:40 +0100 Message-Id: <20200124093130.961598598@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200124093047.008739095@linuxfoundation.org> References: <20200124093047.008739095@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Sender: stable-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Guenter Roeck [ Upstream commit 8dd29f19512cc75ee470d7bb8ec86af199de23a8 ] The driver registers the watchdog with devm_watchdog_register_device() but still calls watchdog_unregister_device() on remove. Since clocks have to be stopped when removing the driver, after the watchdog device has been unregistered, we can not drop the call to watchdog_unregister_device(). Use watchdog_register_device() to register the watchdog. Fixes: 2bdf6acbfead7 ("watchdog: Add Realtek RTD1295") Cc: Andreas Färber Signed-off-by: Guenter Roeck Signed-off-by: Wim Van Sebroeck Signed-off-by: Sasha Levin --- drivers/watchdog/rtd119x_wdt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/watchdog/rtd119x_wdt.c b/drivers/watchdog/rtd119x_wdt.c index d001c17ddfdee..99caec6882d2f 100644 --- a/drivers/watchdog/rtd119x_wdt.c +++ b/drivers/watchdog/rtd119x_wdt.c @@ -135,7 +135,7 @@ static int rtd119x_wdt_probe(struct platform_device *pdev) rtd119x_wdt_set_timeout(&data->wdt_dev, data->wdt_dev.timeout); rtd119x_wdt_stop(&data->wdt_dev); - ret = devm_watchdog_register_device(&pdev->dev, &data->wdt_dev); + ret = watchdog_register_device(&data->wdt_dev); if (ret) { clk_disable_unprepare(data->clk); clk_put(data->clk);