|
@@ -3398,20 +3398,23 @@ EXPORT_SYMBOL_GPL(spi_write_then_read);
|
|
|
|
|
|
/*-------------------------------------------------------------------------*/
|
|
/*-------------------------------------------------------------------------*/
|
|
|
|
|
|
-#if IS_ENABLED(CONFIG_OF_DYNAMIC)
|
|
|
|
|
|
+#if IS_ENABLED(CONFIG_OF)
|
|
static int __spi_of_device_match(struct device *dev, void *data)
|
|
static int __spi_of_device_match(struct device *dev, void *data)
|
|
{
|
|
{
|
|
return dev->of_node == data;
|
|
return dev->of_node == data;
|
|
}
|
|
}
|
|
|
|
|
|
/* must call put_device() when done with returned spi_device device */
|
|
/* must call put_device() when done with returned spi_device device */
|
|
-static struct spi_device *of_find_spi_device_by_node(struct device_node *node)
|
|
|
|
|
|
+struct spi_device *of_find_spi_device_by_node(struct device_node *node)
|
|
{
|
|
{
|
|
struct device *dev = bus_find_device(&spi_bus_type, NULL, node,
|
|
struct device *dev = bus_find_device(&spi_bus_type, NULL, node,
|
|
__spi_of_device_match);
|
|
__spi_of_device_match);
|
|
return dev ? to_spi_device(dev) : NULL;
|
|
return dev ? to_spi_device(dev) : NULL;
|
|
}
|
|
}
|
|
|
|
+EXPORT_SYMBOL_GPL(of_find_spi_device_by_node);
|
|
|
|
+#endif /* IS_ENABLED(CONFIG_OF) */
|
|
|
|
|
|
|
|
+#if IS_ENABLED(CONFIG_OF_DYNAMIC)
|
|
static int __spi_of_controller_match(struct device *dev, const void *data)
|
|
static int __spi_of_controller_match(struct device *dev, const void *data)
|
|
{
|
|
{
|
|
return dev->of_node == data;
|
|
return dev->of_node == data;
|