- 20 1月, 2015 9 次提交
-
-
由 Frans Klaver 提交于
The function pointers for the timers and pm_power_off are assigned with C++ style foo = &func; Let's change it instead to the more C style foo = func; Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
ltc2952_poweroff_handler uses gotos to return from the function. Since we don't do cleanups exiting this function, just return IRQ_HANDLED on the spot and be done with it. While at it, remove the variable 'ret'. It was never used very much. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Documentation/SubmittingDrivers suggests these be implemented even when they do nothing. On the other hand, the platform code calls these functions 'legacy'. Suspend and resume operations should go into a pm_ops structure, pointed at by the driver's pm field. This approach would lead to a lot of boiler plate, while achieving nothing. Drop the functions instead. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
As per Documentation/CodingStyle ch.4, we should keep global variables to a mininum. Move the panic state into the driver data, regardless of whether panic is a system state or not. This removes the need for the custom _init and _exit functions, so replace them with a call to the module_platform_driver() macro. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Documentation/CodingStyle ch.4 mentions in a side node that global variables should only be used if you really need them. Reduce the use of the global instance of ltc2952_poweroff so we may eventually remove it entirely. While at it, rename ltc2952_poweroff_data to ltc2952_poweroff, just to save that little bit of typing. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
This reduces cleanup code and chance of errors. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
The three gpio's used by this driver are stored in an array of pointers. This doesn't add much besides cleanups in a loop. In fact, it makes most of the usage sites harder to read. Unroll the loop, and live with the fact that cleanups become slightly larger. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Make use of the fact that we allocated resources can be automatically deallocated. This reduces cleanup code and chance of errors. It also removes the need for the virq member of the ltc2952_poweroff_data struct. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
由 Frans Klaver 提交于
Make use of the fact that the allocated resources can be automatically deallocated. This reduces cleanup code and chance of leaks. Signed-off-by: NFrans Klaver <frans.klaver@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-
- 20 10月, 2014 1 次提交
-
-
由 Wolfram Sang 提交于
A platform_driver does not need to set an owner, it will be populated by the driver core. Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
-
- 16 9月, 2014 1 次提交
-
-
由 René Moll 提交于
This adds a driver for the LTC2952, an external power control chip, which signals the OS to shut down. Additionally this driver lets the kernel power down the board. Signed-off-by: NRené Moll <rene.moll@xsens.com> Signed-off-by: NSebastian Reichel <sre@kernel.org>
-