diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-25 09:25:40 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2021-06-25 10:01:00 +0200 |
commit | bcf372d75b951a53e304266cf9e2b84fb98abc62 (patch) | |
tree | cbe739749aa64d5f24bcb499505737a3a0f178c3 /include | |
parent | cf5356ba153d974a677e05644d34c4486065c924 (diff) | |
download | barebox-bcf372d75b951a53e304266cf9e2b84fb98abc62.tar.gz barebox-bcf372d75b951a53e304266cf9e2b84fb98abc62.tar.xz |
of: Add dummy driver
With deep probe support we decide that a device for a new device node is
available when the device has a driver. It sometimes happens that a
consumer of a device node doesn't point to the node to which the driver
is attached to, but instead a subnode, like this:
usb2phy0: usb2-phy@fe8a0000 {
compatible = "rockchip,rk3568-usb2phy";
u2phy0_host: host-port {
status = "disabled";
};
};
usbhost_dwc3: dwc3@fd000000 {
compatible = "snps,dwc3";
phys = <&u2phy0_host>;
phy-names = "usb2-phy";
};
of_device_ensure_probed() would now expect a driver for the &u2phy0_host
node, but the driver is attached to the &usb2phy0 node. This patch adds
of_platform_device_dummy_drv() which can be used in such situations. When
called on the &u2phy0_host it will attach a dummy driver to it so that
deep probe is happy.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Link: https://lore.barebox.org/20210625072540.32717-20-s.hauer@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r-- | include/of.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/include/of.h b/include/of.h index 98de9d8480..6f1ec94e7e 100644 --- a/include/of.h +++ b/include/of.h @@ -268,6 +268,7 @@ extern int barebox_register_fdt(const void *dtb); extern struct device_d *of_platform_device_create(struct device_node *np, struct device_d *parent); +extern void of_platform_device_dummy_drv(struct device_d *dev); extern int of_platform_populate(struct device_node *root, const struct of_device_id *matches, struct device_d *parent); @@ -365,6 +366,10 @@ static inline struct device_d *of_platform_device_create(struct device_node *np, return NULL; } +static inline void of_platform_device_dummy_drv(struct device_d *dev) +{ +} + static inline int of_device_ensure_probed(struct device_node *np) { return 0; |