submitting-patches.rst (f632a8170a6b667ee4e3f552087588f0fe13c4bb) submitting-patches.rst (fe34c89d25429e079ba67416529514120dd715f8)
1How to Get Your Patch Accepted Into the Hwmon Subsystem
2=======================================================
3
4This text is a collection of suggestions for people writing patches or
5drivers for the hwmon subsystem. Following these suggestions will greatly
6increase the chances of your change being accepted.
7
8

--- 75 unchanged lines hidden (view full) ---

84* Limit the number of kernel log messages. In general, your driver should not
85 generate an error message just because a runtime operation failed. Report
86 errors to user space instead, using an appropriate error code. Keep in mind
87 that kernel error log messages not only fill up the kernel log, but also are
88 printed synchronously, most likely with interrupt disabled, often to a serial
89 console. Excessive logging can seriously affect system performance.
90
91* Use devres functions whenever possible to allocate resources. For rationale
1How to Get Your Patch Accepted Into the Hwmon Subsystem
2=======================================================
3
4This text is a collection of suggestions for people writing patches or
5drivers for the hwmon subsystem. Following these suggestions will greatly
6increase the chances of your change being accepted.
7
8

--- 75 unchanged lines hidden (view full) ---

84* Limit the number of kernel log messages. In general, your driver should not
85 generate an error message just because a runtime operation failed. Report
86 errors to user space instead, using an appropriate error code. Keep in mind
87 that kernel error log messages not only fill up the kernel log, but also are
88 printed synchronously, most likely with interrupt disabled, often to a serial
89 console. Excessive logging can seriously affect system performance.
90
91* Use devres functions whenever possible to allocate resources. For rationale
92 and supported functions, please see Documentation/driver-model/devres.rst.
92 and supported functions, please see Documentation/driver-api/driver-model/devres.rst.
93 If a function is not supported by devres, consider using devm_add_action().
94
95* If the driver has a detect function, make sure it is silent. Debug messages
96 and messages printed after a successful detection are acceptable, but it
97 must not print messages such as "Chip XXX not found/supported".
98
99 Keep in mind that the detect function will run for all drivers supporting an
100 address if a chip is detected on that address. Unnecessary messages will just

--- 46 unchanged lines hidden ---
93 If a function is not supported by devres, consider using devm_add_action().
94
95* If the driver has a detect function, make sure it is silent. Debug messages
96 and messages printed after a successful detection are acceptable, but it
97 must not print messages such as "Chip XXX not found/supported".
98
99 Keep in mind that the detect function will run for all drivers supporting an
100 address if a chip is detected on that address. Unnecessary messages will just

--- 46 unchanged lines hidden ---