Skip to content

Commit bef852d

Browse files
Sakari AilusHans Verkuil
authored andcommitted
media: ipu-bridge: Serialise calls to IPU bridge init
The IPU bridge initialisation will be called from multiple locations in the future. Serialise the access to devices' fwnodes in this context. Signed-off-by: Sakari Ailus <[email protected]> Signed-off-by: Hans Verkuil <[email protected]>
1 parent e0251c2 commit bef852d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

drivers/media/pci/intel/ipu-bridge.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -766,6 +766,8 @@ static int ipu_bridge_check_fwnode_graph(struct fwnode_handle *fwnode)
766766
return ipu_bridge_check_fwnode_graph(fwnode->secondary);
767767
}
768768

769+
static DEFINE_MUTEX(ipu_bridge_mutex);
770+
769771
int ipu_bridge_init(struct device *dev,
770772
ipu_parse_sensor_fwnode_t parse_sensor_fwnode)
771773
{
@@ -774,6 +776,8 @@ int ipu_bridge_init(struct device *dev,
774776
unsigned int i;
775777
int ret;
776778

779+
guard(mutex)(&ipu_bridge_mutex);
780+
777781
if (!ipu_bridge_check_fwnode_graph(dev_fwnode(dev)))
778782
return 0;
779783

0 commit comments

Comments
 (0)