From mboxrd@z Thu Jan 1 00:00:00 1970 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=-15.2 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 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 B2BCAC433ED for ; Mon, 5 Apr 2021 13:23:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 611C7613B1 for ; Mon, 5 Apr 2021 13:23:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235736AbhDENXm (ORCPT ); Mon, 5 Apr 2021 09:23:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54362 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232694AbhDENXm (ORCPT ); Mon, 5 Apr 2021 09:23:42 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 33050C061756 for ; Mon, 5 Apr 2021 06:23:36 -0700 (PDT) Received: from gallifrey.ext.pengutronix.de ([2001:67c:670:201:5054:ff:fe8d:eefb] helo=[127.0.0.1]) by metis.ext.pengutronix.de with esmtp (Exim 4.92) (envelope-from ) id 1lTPCQ-0008U6-EH; Mon, 05 Apr 2021 15:23:26 +0200 Subject: Re: [PATCH] watchdog: imx_sc_wdt: fix pretimeout To: eichest@gmail.com, linux-watchdog@vger.kernel.org Cc: Shawn Guo , Sascha Hauer , NXP Linux Team , Pengutronix Kernel Team , Wim Van Sebroeck , Fabio Estevam , Guenter Roeck References: <20210405125946.369230-1-eichest@gmail.com> From: Ahmad Fatoum Message-ID: Date: Mon, 5 Apr 2021 15:23:24 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.0 MIME-Version: 1.0 In-Reply-To: <20210405125946.369230-1-eichest@gmail.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-SA-Exim-Connect-IP: 2001:67c:670:201:5054:ff:fe8d:eefb X-SA-Exim-Mail-From: a.fatoum@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-watchdog@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-watchdog@vger.kernel.org On 05.04.21 14:59, eichest@gmail.com wrote: > From: Stefan Eichenberger > > If the WDIOF_PRETIMEOUTE flag is not set when registering the device the > driver will not show the sysfs entries or register the default governor. > By moving the registering after the decision whether pretimeout is > supported this gets fixed. > > Signed-off-by: Stefan Eichenberger > --- > drivers/watchdog/imx_sc_wdt.c | 8 ++++---- > 1 file changed, 4 insertions(+), 4 deletions(-) > > diff --git a/drivers/watchdog/imx_sc_wdt.c b/drivers/watchdog/imx_sc_wdt.c > index e9ee22a7cb45..eddb1ae630e0 100644 > --- a/drivers/watchdog/imx_sc_wdt.c > +++ b/drivers/watchdog/imx_sc_wdt.c > @@ -183,10 +183,6 @@ static int imx_sc_wdt_probe(struct platform_device *pdev) > watchdog_stop_on_reboot(wdog); > watchdog_stop_on_unregister(wdog); > > - ret = devm_watchdog_register_device(dev, wdog); > - if (ret) > - return ret; > - > ret = imx_scu_irq_group_enable(SC_IRQ_GROUP_WDOG, > SC_IRQ_WDOG, > true); > @@ -213,6 +209,10 @@ static int imx_sc_wdt_probe(struct platform_device *pdev) > else > dev_warn(dev, "Add action failed, pretimeout NOT supported\n"); > > + ret = devm_watchdog_register_device(dev, wdog); > + if (ret) > + return ret; This could be rewritten as return devm_watchdog_register_device(dev, wdog); > + > return 0; > } > > -- Pengutronix e.K. | | Steuerwalder Str. 21 | http://www.pengutronix.de/ | 31137 Hildesheim, Germany | Phone: +49-5121-206917-0 | Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-5555 |