Re: [RFC PATCH v2 1/4] watchdog: core: add mechanism to prevent removing if NOWAYOUT

2018-08-28 Thread Guenter Roeck
On Tue, Aug 28, 2018 at 10:07:40PM +0200, Wolfram Sang wrote: > Hi Guenter, > > > > + __driver.remove = NULL; \ > > > > Does that really do any good ? If I understand correctly, the only > > impact is that the platform driver remove function will believe that > > nothing needs to be done

Re: [RFC PATCH v2 1/4] watchdog: core: add mechanism to prevent removing if NOWAYOUT

2018-08-28 Thread Wolfram Sang
Hi Guenter, > > + __driver.remove = NULL; \ > > Does that really do any good ? If I understand correctly, the only > impact is that the platform driver remove function will believe that > nothing needs to be done on removal. See platform_drv_remove(). This might be biased for my use ca

Re: [RFC PATCH v2 1/4] watchdog: core: add mechanism to prevent removing if NOWAYOUT

2018-08-28 Thread Guenter Roeck
On Tue, Aug 28, 2018 at 09:14:13PM +0200, Wolfram Sang wrote: > To prevent removing if NOWAYOUT, we invalidate the .remove function and > suppress the bind/unbind attributes in sysfs. These are driver > capabilities, so we need to set it up at runtime during init. To avoid > boilerplate, introduce

[RFC PATCH v2 1/4] watchdog: core: add mechanism to prevent removing if NOWAYOUT

2018-08-28 Thread Wolfram Sang
To prevent removing if NOWAYOUT, we invalidate the .remove function and suppress the bind/unbind attributes in sysfs. These are driver capabilities, so we need to set it up at runtime during init. To avoid boilerplate, introduce module_watchdog_driver() similar to module_driver(). On top of that, w