linux-yocto/drivers/nvdimm
Zijun Hu f1e8bf5632 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 <alison.schofield@intel.com>
Reviewed-by: Takashi Sakamoto <o-takashi@sakamocchi.jp>
Acked-by: Uwe Kleine-König <ukleinek@kernel.org> # for drivers/pwm
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Reviewed-by: Mathieu Poirier <mathieu.poirier@linaro.org>
Link: https://lore.kernel.org/r/20241224-const_dfc_done-v5-4-6623037414d4@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2025-01-03 11:19:35 +01:00
..
badrange.c libnvdimm: remove kernel-doc warnings: 2023-10-18 09:48:05 -07:00
btt_devs.c nvdimm: Remove usage of the deprecated ida_simple_xx() API 2024-01-03 12:21:36 -08:00
btt.c 6.11 updates for libnvdimm 2024-07-20 11:26:02 -07:00
btt.h
bus.c driver core: Constify API device_find_child() and adapt for various usages 2025-01-03 11:19:35 +01:00
claim.c libnvdimm: Replace namespace_match() with device_find_child_by_name() 2025-01-03 11:19:34 +01:00
core.c nvdimm: add missing MODULE_DESCRIPTION() macros 2024-06-17 18:41:48 -05:00
dax_devs.c nvdimm: rectify the illogical code within nd_dax_probe() 2024-11-13 12:58:37 -06:00
dimm_devs.c nvdimm/dimm_devs: fix kernel-doc for function params 2024-01-03 12:21:36 -08:00
dimm.c
e820.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
Kconfig libnvdimm: Fix ACPI_NFIT in BLK_DEV_PMEM help 2024-02-12 14:32:25 -07:00
label.c
label.h
Makefile
namespace_devs.c nvdimm: Remove dead code for ENODEV checking in scan_labels() 2024-08-21 16:06:43 -05:00
nd_perf.c
nd_virtio.c nvdimm: Correct some typos in comments 2024-11-13 12:32:57 -06:00
nd-core.h
nd.h nvdimm: rectify the illogical code within nd_dax_probe() 2024-11-13 12:58:37 -06:00
of_pmem.c Get rid of 'remove_new' relic from platform driver struct 2024-12-01 15:12:43 -08:00
pfn_devs.c nvdimm: Correct some typos in comments 2024-11-13 12:32:57 -06:00
pfn.h
pmem.c nvdimm: Correct some typos in comments 2024-11-13 12:32:57 -06:00
pmem.h
region_devs.c module: Convert symbol namespace to string literal 2024-12-02 11:34:44 -08:00
region.c
security.c
virtio_pmem.c virtio_pmem: Add freeze/restore callbacks 2024-11-12 18:07:24 -05:00
virtio_pmem.h