Skip to content

Commit 9937b8d

Browse files
Ionut NicuWolfram Sang
authored andcommitted
i2c: i2c-mux-gpio: use deferred probing
If the i2c-parent bus driver is not loaded, returning -ENODEV will force people to unload and then reload the module again to get it working. Signed-off-by: Ionut Nicu <[email protected]> Acked-by: Peter Korsgaard <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 492ed77 commit 9937b8d

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

drivers/i2c/muxes/i2c-mux-gpio.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
7979
adapter = of_find_i2c_adapter_by_node(adapter_np);
8080
if (!adapter) {
8181
dev_err(&pdev->dev, "Cannot find parent bus\n");
82-
return -ENODEV;
82+
return -EPROBE_DEFER;
8383
}
8484
mux->data.parent = i2c_adapter_id(adapter);
8585
put_device(&adapter->dev);
@@ -181,7 +181,7 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
181181
if (!parent) {
182182
dev_err(&pdev->dev, "Parent adapter (%d) not found\n",
183183
mux->data.parent);
184-
return -ENODEV;
184+
return -EPROBE_DEFER;
185185
}
186186

187187
mux->parent = parent;

0 commit comments

Comments
 (0)