linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1 1/4] media: ipu3-cio2: Don't dereference fwnode handle
@ 2022-11-18 18:56 Andy Shevchenko
  2022-11-18 18:56 ` [PATCH v1 2/4] media: ipu3-cio2: Convert to use software_node_register_node_group() Andy Shevchenko
                   ` (4 more replies)
  0 siblings, 5 replies; 16+ messages in thread
From: Andy Shevchenko @ 2022-11-18 18:56 UTC (permalink / raw)
  To: Clément Léger, Andy Shevchenko, Sakari Ailus,
	Mauro Carvalho Chehab, Hans de Goede, linux-acpi, linux-kernel,
	linux-media
  Cc: Daniel Scally, Heikki Krogerus, Greg Kroah-Hartman,
	Rafael J. Wysocki, Yong Zhi, Bingbu Cao, Tianshu Qiu

Use acpi_fwnode_handle() instead of dereferencing an fwnode handle directly,
which is a better coding practice.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/media/pci/intel/ipu3/cio2-bridge.c | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c
index df6c94da2f6a..18974a72e94a 100644
--- a/drivers/media/pci/intel/ipu3/cio2-bridge.c
+++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c
@@ -263,7 +263,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
 				      struct cio2_bridge *bridge,
 				      struct pci_dev *cio2)
 {
-	struct fwnode_handle *fwnode;
+	struct fwnode_handle *fwnode, *primary;
 	struct cio2_sensor *sensor;
 	struct acpi_device *adev;
 	acpi_status status;
@@ -322,7 +322,9 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg,
 		}
 
 		sensor->adev = acpi_dev_get(adev);
-		adev->fwnode.secondary = fwnode;
+
+		primary = acpi_fwnode_handle(adev);
+		primary->secondary = fwnode;
 
 		cio2_bridge_instantiate_vcm_i2c_client(sensor);
 
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 16+ messages in thread

end of thread, other threads:[~2022-11-23 19:25 UTC | newest]

Thread overview: 16+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-18 18:56 [PATCH v1 1/4] media: ipu3-cio2: Don't dereference fwnode handle Andy Shevchenko
2022-11-18 18:56 ` [PATCH v1 2/4] media: ipu3-cio2: Convert to use software_node_register_node_group() Andy Shevchenko
2022-11-21 10:19   ` Dan Scally
2022-11-21 10:22     ` Hans de Goede
2022-11-21 10:23       ` Daniel Scally
2022-11-21 10:27       ` Andy Shevchenko
2022-11-21 14:32         ` Dan Scally
2022-11-21 14:40           ` Hans de Goede
2022-11-18 18:56 ` [PATCH v1 3/4] software node: Switch property entry test to new API Andy Shevchenko
2022-11-23 19:01   ` Greg Kroah-Hartman
2022-11-23 19:07     ` Andy Shevchenko
2022-11-23 19:25       ` Greg Kroah-Hartman
2022-11-18 18:56 ` [PATCH v1 4/4] software node: Remove unused APIs Andy Shevchenko
2022-11-23 19:02   ` Greg Kroah-Hartman
2022-11-21  9:02 ` [PATCH v1 1/4] media: ipu3-cio2: Don't dereference fwnode handle Heikki Krogerus
2022-11-21 10:01 ` Dan Scally

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).