The firmware device node was added to struct device in ce793486e
"driver core / ACPI: Represent ACPI companions using fwnode_handle" do
not access it on older kernel versions.

Signed-off-by: Hauke Mehrtens <ha...@hauke-m.de>
---
 .../media/0007-no-fwnode/v4l2.patch                | 26 ++++++++++++++++++++++
 1 file changed, 26 insertions(+)
 create mode 100644 
patches/collateral-evolutions/media/0007-no-fwnode/v4l2.patch

diff --git a/patches/collateral-evolutions/media/0007-no-fwnode/v4l2.patch 
b/patches/collateral-evolutions/media/0007-no-fwnode/v4l2.patch
new file mode 100644
index 0000000..1535749
--- /dev/null
+++ b/patches/collateral-evolutions/media/0007-no-fwnode/v4l2.patch
@@ -0,0 +1,26 @@
+--- a/drivers/media/v4l2-core/v4l2-device.c
++++ b/drivers/media/v4l2-core/v4l2-device.c
+@@ -131,7 +131,11 @@ void v4l2_device_unregister(struct v4l2_
+                        * re-created by just probing the V4L2 driver.
+                        */
+                       if (client &&
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
+                           !client->dev.of_node && !client->dev.fwnode)
++#else
++                          !client->dev.of_node)
++#endif
+                               i2c_unregister_device(client);
+                       continue;
+               }
+@@ -140,7 +144,11 @@ void v4l2_device_unregister(struct v4l2_
+               if (sd->flags & V4L2_SUBDEV_FL_IS_SPI) {
+                       struct spi_device *spi = v4l2_get_subdevdata(sd);
+ 
++#if LINUX_VERSION_CODE >= KERNEL_VERSION(4,1,0)
+                       if (spi && !spi->dev.of_node && !spi->dev.fwnode)
++#else
++                      if (spi && !spi->dev.of_node)
++#endif
+                               spi_unregister_device(spi);
+                       continue;
+               }
-- 
2.6.2

--
To unsubscribe from this list: send the line "unsubscribe backports" in

Reply via email to