Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

watchdog: mena21: Do not use device pointer from struct watchdog_device

The device pointer in struct watchdog_device has a different lifetime
than the driver code and should not be used in drivers. Use the pointer
to the parent device instead.

Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Wim Van Sebroeck <wim@iguana.be>

authored by

Guenter Roeck and committed by
Wim Van Sebroeck
07352366 8a7b76be

+2 -2
+2 -2
drivers/watchdog/mena21_wdt.c
··· 100 100 struct a21_wdt_drv *drv = watchdog_get_drvdata(wdt); 101 101 102 102 if (timeout != 1 && timeout != 30) { 103 - dev_err(wdt->dev, "Only 1 and 30 allowed as timeout\n"); 103 + dev_err(wdt->parent, "Only 1 and 30 allowed as timeout\n"); 104 104 return -EINVAL; 105 105 } 106 106 107 107 if (timeout == 30 && wdt->timeout == 1) { 108 - dev_err(wdt->dev, 108 + dev_err(wdt->parent, 109 109 "Transition from fast to slow mode not allowed\n"); 110 110 return -EINVAL; 111 111 }