ANDROID: spi: of: Populate fwnode in of_register_spi_device

This allows the of_devlink feature to work across spi devices too.  This
avoid unnecessary probe deferrals of spi devices, defers consumers of
spi devices till the spi devices probe, and allows spi drivers to
implement sync_state() callbacks.

Signed-off-by: Daniel Mentz <danielmentz@google.com>
Change-Id: I5b6a9423815b144e9e57074f0d380b1978f9a4f5
(cherry picked from commit f3bd5bff1e5e21941df1fbaa24d9fa8a5e02cf5e)
(cherry picked from commit b08a50dfd398c4f854bbdd959e763cfb38f9a578)
Signed-off-by: Will McVicker <willmcvicker@google.com>
(cherry picked from commit 624c2f0ea860fe09ef39ad0310777e8d7693dfa7)
Signed-off-by: Will McVicker <willmcvicker@google.com>
This commit is contained in:
Daniel Mentz 2020-08-13 18:53:03 -07:00 committed by Greg Kroah-Hartman
parent d30c303aab
commit f93a33edc8

View File

@ -2026,6 +2026,7 @@ of_register_spi_device(struct spi_controller *ctlr, struct device_node *nc)
/* Store a pointer to the node in the device structure */
of_node_get(nc);
spi->dev.of_node = nc;
spi->dev.fwnode = of_fwnode_handle(nc);
/* Register the new device */
rc = spi_add_device(spi);