diff options
author | Sakari Ailus <sakari.ailus@linux.intel.com> | 2024-02-13 12:42:30 +0300 |
---|---|---|
committer | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2024-02-23 16:33:32 +0300 |
commit | bef852dcd5a16418856b69699484c7df6803917b (patch) | |
tree | 9e4f647fe3c2e66a9b67af1262a1fc868464349a | |
parent | e0251c2a1dec8b71af5ea030564b2ca3d937b0fc (diff) | |
download | linux-bef852dcd5a16418856b69699484c7df6803917b.tar.xz |
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 <sakari.ailus@linux.intel.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
-rw-r--r-- | drivers/media/pci/intel/ipu-bridge.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/media/pci/intel/ipu-bridge.c b/drivers/media/pci/intel/ipu-bridge.c index 735c62c37c22..e994db4f4d91 100644 --- a/drivers/media/pci/intel/ipu-bridge.c +++ b/drivers/media/pci/intel/ipu-bridge.c @@ -766,6 +766,8 @@ static int ipu_bridge_check_fwnode_graph(struct fwnode_handle *fwnode) return ipu_bridge_check_fwnode_graph(fwnode->secondary); } +static DEFINE_MUTEX(ipu_bridge_mutex); + int ipu_bridge_init(struct device *dev, ipu_parse_sensor_fwnode_t parse_sensor_fwnode) { @@ -774,6 +776,8 @@ int ipu_bridge_init(struct device *dev, unsigned int i; int ret; + guard(mutex)(&ipu_bridge_mutex); + if (!ipu_bridge_check_fwnode_graph(dev_fwnode(dev))) return 0; |