i2c: i2c-mux-gpio: use deferred probing
authorIonut Nicu <ioan.nicu.ext@nsn.com>
Wed, 9 Oct 2013 09:50:45 +0000 (11:50 +0200)
committerWolfram Sang <wsa@the-dreams.de>
Thu, 10 Oct 2013 08:22:33 +0000 (10:22 +0200)
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 <ioan.nicu.ext@nsn.com>
Acked-by: Peter Korsgaard <peter.korsgaard@barco.com>
Signed-off-by: Wolfram Sang <wsa@the-dreams.de>
drivers/i2c/muxes/i2c-mux-gpio.c

index 7f343bcd492ee018b1e3413d62a660fa157339c6..a764da777f08027da102e244556f9bb424b59494 100644 (file)
@@ -79,7 +79,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux,
        adapter = of_find_i2c_adapter_by_node(adapter_np);
        if (!adapter) {
                dev_err(&pdev->dev, "Cannot find parent bus\n");
-               return -ENODEV;
+               return -EPROBE_DEFER;
        }
        mux->data.parent = i2c_adapter_id(adapter);
        put_device(&adapter->dev);
@@ -181,7 +181,7 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
        if (!parent) {
                dev_err(&pdev->dev, "Parent adapter (%d) not found\n",
                        mux->data.parent);
-               return -ENODEV;
+               return -EPROBE_DEFER;
        }
 
        mux->parent = parent;