lkml.org 
[lkml]   [2023]   [Mar]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/3] watchdog: wm8350: Simplify using devm_watchdog_register_device()
    Date
    This allows to drop the .remove() function as it only exists to
    unregister the watchdog device which is now done in a callback
    registered by devm_watchdog_register_device().

    Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
    ---
    drivers/watchdog/wm8350_wdt.c | 9 +--------
    1 file changed, 1 insertion(+), 8 deletions(-)

    diff --git a/drivers/watchdog/wm8350_wdt.c b/drivers/watchdog/wm8350_wdt.c
    index 33c62d51f00a..911ad64460a6 100644
    --- a/drivers/watchdog/wm8350_wdt.c
    +++ b/drivers/watchdog/wm8350_wdt.c
    @@ -153,18 +153,11 @@ static int wm8350_wdt_probe(struct platform_device *pdev)
    /* Default to 4s timeout */
    wm8350_wdt_set_timeout(&wm8350_wdt, 4);

    - return watchdog_register_device(&wm8350_wdt);
    -}
    -
    -static int wm8350_wdt_remove(struct platform_device *pdev)
    -{
    - watchdog_unregister_device(&wm8350_wdt);
    - return 0;
    + return devm_watchdog_register_device(&wm8350_wdt);
    }

    static struct platform_driver wm8350_wdt_driver = {
    .probe = wm8350_wdt_probe,
    - .remove = wm8350_wdt_remove,
    .driver = {
    .name = "wm8350-wdt",
    },
    --
    2.39.1
    \
     
     \ /
      Last update: 2023-03-27 00:45    [W:5.969 / U:0.072 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site