Move fwnode_connection_find_match() under drivers/base/property.c
Subsystems (4)
Heikki Krogerus
reviewerv2 cover Move fwnode_connection_find_match() under drivers/base/property.c
This is second version of this series. I forgot to remove the file from Documentation/driver-api/index.rst. Hopefully these are now OK.
The original cover letter:
Hi,
This was the last patch in my series that removed struct device_connection [1]. It's now split into two separate patches.
[1] https://lore.kernel.org/lkml/[email protected]/
thanks,
*** BLURB HERE ***
Heikki Krogerus (2):
device property: Move fwnode_connection_find_match() under
drivers/base/property.c
Documentation: Remove device connection documentation
.../driver-api/device_connection.rst | 43 -------- Documentation/driver-api/index.rst | 1 - drivers/base/Makefile | 2 +- drivers/base/devcon.c | 101 ------------------ drivers/base/property.c | 73 +++++++++++++ include/linux/device.h | 9 -- include/linux/property.h | 14 +++ 7 files changed, 88 insertions(+), 155 deletions(-) delete mode 100644 Documentation/driver-api/device_connection.rst delete mode 100644 drivers/base/devcon.c
Signature · 1 line
2.28.0
Heikki Krogerus
reviewerPATCH v2 1/2 device property: Move fwnode_connection_find_match() under drivers/base/property.c
The function is now only a helper that searches the connection from device graph and then by checking if the supplied connection identifier matches a property that contains reference.
--- drivers/base/Makefile | 2 +- drivers/base/devcon.c | 101 --------------------------------------- drivers/base/property.c | 73 ++++++++++++++++++++++++++++ include/linux/device.h | 9 ---- include/linux/property.h | 14 ++++++ 5 files changed, 88 insertions(+), 111 deletions(-) delete mode 100644 drivers/base/devcon.c
drivers/base/Makefile +1 -1
@@ -6,7 +6,7 @@ obj-y := component.o core.o bus.o dd.o syscore.o \ cpu.o firmware.o init.o map.o devres.o \ attribute_container.o transport_class.o \ topology.o container.o property.o cacheinfo.o \ - devcon.o swnode.o + swnode.o obj-$(CONFIG_DEVTMPFS) += devtmpfs.o obj-y += power/ obj-$(CONFIG_ISA_BUS_API) += isa.o
drivers/base/devcon.c deleted +0 -101
101 lines not on this page · raw message
drivers/base/property.c +73 -0
76 lines not on this page · raw message
include/linux/device.h +0 -9
@@ -292,15 +292,6 @@ struct device_dma_parameters {unsigned long segment_boundary_mask; }; -typedef void *(*devcon_match_fn_t )(struct fwnode_handle *fwnode,const char *id, -void *data); - -void *fwnode_connection_find_match (struct fwnode_handle *fwnode, -const char *con_id,void *data, -devcon_match_fn_t match); -void *device_connection_find_match (struct device *dev,const char *con_id, -void *data,devcon_match_fn_t match); -/** * enum device_link_state - Device link states. * @DL_STATE_NONE: The presence of the drivers is not being tracked.
include/linux/property.h +14 -0
@@ -418,6 +418,20 @@ fwnode_graph_get_endpoint_by_id(const struct fwnode_handle *fwnode,int fwnode_graph_parse_endpoint (const struct fwnode_handle *fwnode,struct fwnode_endpoint *endpoint); +typedef void *(*devcon_match_fn_t )(struct fwnode_handle *fwnode,const char *id, +void *data); + +void *fwnode_connection_find_match (struct fwnode_handle *fwnode, +const char *con_id,void *data, +devcon_match_fn_t match); + +static inline void *device_connection_find_match (struct device *dev, +const char *con_id,void *data, +devcon_match_fn_t match) +{ +return fwnode_connection_find_match (dev_fwnode (dev), con_id, data, match); +} +/* -------------------------------------------------------------------------- */ /* Software fwnode support - when HW description is incomplete or missing */
Signature · 1 line
2.28.0
Greg Kroah-Hartman
maintainerQuoted 7 lines · Heikki Krogerus
This is second version of this series. I forgot to remove the file from
Documentation/driver-api/index.rst. Hopefully these are now OK.The original cover letter:
Hi,
Quoted 8 lines
This was the last patch in my series that removed struct
device_connection[1]. It's now split into two separate patches.[1] https://lore.kernel.org/lkml/[email protected]/
thanks,
*** BLURB HERE ***
But you do have a blurb! :)
Anyway, thanks for the update, both now applied.
greg k-h
Heikki Krogerus
reviewerPATCH v2 2/2 Documentation: Remove device connection documentation
In reply to Heikki KrogerusThe API that allowed device connection descriptions to be added is now removed, so removing also the documentation for it.
--- .../driver-api/device_connection.rst | 43 ------------------- Documentation/driver-api/index.rst | 1 - 2 files changed, 44 deletions(-) delete mode 100644 Documentation/driver-api/device_connection.rst
Documentation/driver-api/device_connection.rst deleted +0 -43
@@ -1,43 +0,0 @@ -================== -Device connections -================== - -Introduction ------------- - -Devices often have connections to other devices that are outside of the direct -child/parent relationship. A serial or network communication controller, which -could be a PCI device, may need to be able to get a reference to its PHY -component, which could be attached for example to the I2C bus. Some device -drivers need to be able to control the clocks or the GPIOs for their devices, -and so on. - -Device connections are generic descriptions of any type of connection between -two separate devices. - -Device connections alone do not create a dependency between the two devices. -They are only descriptions which are not tied to either of the devices directly. -A dependency between the two devices exists only if one of the two endpoint -devices requests a reference to the other. The descriptions themselves can be -defined in firmware (not yet supported) or they can be built-in. - -Usage ------ - -Device connections should exist before device ``->probe`` callback is called for -either endpoint device in the description. If the connections are defined in -firmware, this is not a problem. It should be considered if the connection -descriptions are "built-in", and need to be added separately. - -The connection description consists of the names of the two devices with the -connection, i.e. the endpoints, and unique identifier for the connection which -is needed if there are multiple connections between the two devices. - -After a description exists, the devices in it can request reference to the other -endpoint device, or they can request the description itself. - -API ---- - -.. kernel-doc:: drivers/base/devcon.c - :functions: device_connection_find_match device_connection_find device_connection_add device_connection_remove
Documentation/driver-api/index.rst +0 -1
@@ -22,7 +22,6 @@ available subsections can be seen below. pm/index clk device-io - device_connection dma-buf device_link component
Signature · 1 line
2.28.0