| f1e8bf56 | 24-Dec-2024 |
Zijun Hu <[email protected]> |
driver core: Constify API device_find_child() and adapt for various usages
Constify the following API: struct device *device_find_child(struct device *dev, void *data, int (*match)(struct device *
driver core: Constify API device_find_child() and adapt for various usages
Constify the following API: struct device *device_find_child(struct device *dev, void *data, int (*match)(struct device *dev, void *data)); To : struct device *device_find_child(struct device *dev, const void *data, device_match_t match); typedef int (*device_match_t)(struct device *dev, const void *data); with the following reasons:
- Protect caller's match data @*data which is for comparison and lookup and the API does not actually need to modify @*data.
- Make the API's parameters (@match)() and @data have the same type as all of other device finding APIs (bus|class|driver)_find_device().
- All kinds of existing device match functions can be directly taken as the API's argument, they were exported by driver core.
Constify the API and adapt for various existing usages.
BTW, various subsystem changes are squashed into this commit to meet 'git bisect' requirement, and this commit has the minimal and simplest changes to complement squashing shortcoming, and that may bring extra code improvement.
Reviewed-by: Alison Schofield <[email protected]> Reviewed-by: Takashi Sakamoto <[email protected]> Acked-by: Uwe Kleine-König <[email protected]> # for drivers/pwm Signed-off-by: Zijun Hu <[email protected]> Reviewed-by: Jonathan Cameron <[email protected]> Reviewed-by: Mathieu Poirier <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 088c588f | 02-Sep-2024 |
Wolfram Sang <[email protected]> |
slimbus: qcom-ngd-ctrl: use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_compl
slimbus: qcom-ngd-ctrl: use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like:
timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT;
with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining.
Fix to the proper variable type 'unsigned long' while here.
Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 9c6fd5fc | 02-Sep-2024 |
Wolfram Sang <[email protected]> |
slimbus: qcom-ctrl: use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completio
slimbus: qcom-ctrl: use 'time_left' variable with wait_for_completion_timeout()
There is a confusing pattern in the kernel to use a variable named 'timeout' to store the result of wait_for_completion_timeout() causing patterns like:
timeout = wait_for_completion_timeout(...) if (!timeout) return -ETIMEDOUT;
with all kinds of permutations. Use 'time_left' as a variable to make the code self explaining.
Fix to the proper variable type 'unsigned long' while here.
Signed-off-by: Wolfram Sang <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Reviewed-by: Bjorn Andersson <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 35230d31 | 30-Apr-2024 |
Krzysztof Kozlowski <[email protected]> |
slimbus: qcom-ctrl: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded based on the alias from of_device_id table. Pin controllers are considered core comp
slimbus: qcom-ctrl: fix module autoloading
Add MODULE_DEVICE_TABLE(), so the module could be properly autoloaded based on the alias from of_device_id table. Pin controllers are considered core components, so usually they are built-in, however these
Signed-off-by: Krzysztof Kozlowski <[email protected]> Reviewed-by: Konrad Dybcio <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 880b33b0 | 30-Apr-2024 |
Uwe Kleine-König <[email protected]> |
slimbus: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handl
slimbus: Convert to platform remove callback returning void
The .remove() callback for a platform driver returns an int which makes many driver authors wrongly assume it's possible to do error handling by returning an error code. However the value returned is ignored (apart from emitting a warning) and this typically results in resource leaks.
To improve here there is a quest to make the remove callback return void. In the first step of this quest all drivers are converted to .remove_new(), which already returns void. Eventually after all drivers are converted, .remove_new() will be renamed to .remove().
Trivially convert the slimbus drivers from always returning zero in the remove callback to the void returning variant.
Signed-off-by: Uwe Kleine-König <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| ab23f1bf | 24-Feb-2024 |
Ricardo B. Marliere <[email protected]> |
slimbus: core: make slimbus_bus const
Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the slim
slimbus: core: make slimbus_bus const
Since commit d492cc2573a0 ("driver core: device.h: make struct bus_type a const *"), the driver core can properly handle constant struct bus_type, move the slimbus_bus variable to be a constant structure as well, placing it into read-only memory which can not be modified at runtime.
Cc: Greg Kroah-Hartman <[email protected]> Suggested-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: "Ricardo B. Marliere" <[email protected]> Reviewed-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 56c7659a | 24-Feb-2024 |
Jeff Johnson <[email protected]> |
slimbus: qcom-ngd-ctrl: Make QMI message rules const
Commit ff6d365898d4 ("soc: qcom: qmi: use const for struct qmi_elem_info") allows QMI message encoding/decoding rules to be const, so do that for
slimbus: qcom-ngd-ctrl: Make QMI message rules const
Commit ff6d365898d4 ("soc: qcom: qmi: use const for struct qmi_elem_info") allows QMI message encoding/decoding rules to be const, so do that for qcom-ngd-ctrl.c.
Signed-off-by: Jeff Johnson <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| 8c8112d7 | 18-Nov-2022 |
Krzysztof Kozlowski <[email protected]> |
slimbus: qcom-ctrl: drop unneeded qcom,apq8064-slim compatible
Bindings require usage of fallback "qcom,slim" compatible, so "qcom,apq8064-slim" is redundant.
Signed-off-by: Krzysztof Kozlowski <kr
slimbus: qcom-ctrl: drop unneeded qcom,apq8064-slim compatible
Bindings require usage of fallback "qcom,slim" compatible, so "qcom,apq8064-slim" is redundant.
Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|
| a82b1ec3 | 18-Nov-2022 |
Krzysztof Kozlowski <[email protected]> |
slimbus: stream: add checks for invalid unprepare/disable usage
slim_disable_stream() and slim_stream_unprepare() are exported, so add sanity checks preventing unmatched/invalid calls.
Signed-off-b
slimbus: stream: add checks for invalid unprepare/disable usage
slim_disable_stream() and slim_stream_unprepare() are exported, so add sanity checks preventing unmatched/invalid calls.
Signed-off-by: Krzysztof Kozlowski <[email protected]> Signed-off-by: Srinivas Kandagatla <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Greg Kroah-Hartman <[email protected]>
show more ...
|