diff options
Diffstat (limited to 'drivers/i2c')
-rw-r--r-- | drivers/i2c/busses/i2c-designware-core.c | 26 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-designware-platdrv.c | 5 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-imx.c | 11 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-ismt.c | 3 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mv64xxx.c | 16 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-mxs.c | 3 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-omap.c | 3 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-s3c2410.c | 2 | ||||
-rw-r--r-- | drivers/i2c/busses/i2c-stu300.c | 11 | ||||
-rw-r--r-- | drivers/i2c/i2c-core.c | 3 | ||||
-rw-r--r-- | drivers/i2c/muxes/i2c-arb-gpio-challenge.c | 2 | ||||
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-gpio.c | 14 | ||||
-rw-r--r-- | drivers/i2c/muxes/i2c-mux-pinctrl.c | 4 |
13 files changed, 66 insertions, 37 deletions
diff --git a/drivers/i2c/busses/i2c-designware-core.c b/drivers/i2c/busses/i2c-designware-core.c index dbecf08399f8..5888feef1ac5 100644 --- a/drivers/i2c/busses/i2c-designware-core.c +++ b/drivers/i2c/busses/i2c-designware-core.c | |||
@@ -98,6 +98,8 @@ | |||
98 | 98 | ||
99 | #define DW_IC_ERR_TX_ABRT 0x1 | 99 | #define DW_IC_ERR_TX_ABRT 0x1 |
100 | 100 | ||
101 | #define DW_IC_TAR_10BITADDR_MASTER BIT(12) | ||
102 | |||
101 | /* | 103 | /* |
102 | * status codes | 104 | * status codes |
103 | */ | 105 | */ |
@@ -388,22 +390,34 @@ static int i2c_dw_wait_bus_not_busy(struct dw_i2c_dev *dev) | |||
388 | static void i2c_dw_xfer_init(struct dw_i2c_dev *dev) | 390 | static void i2c_dw_xfer_init(struct dw_i2c_dev *dev) |
389 | { | 391 | { |
390 | struct i2c_msg *msgs = dev->msgs; | 392 | struct i2c_msg *msgs = dev->msgs; |
391 | u32 ic_con; | 393 | u32 ic_con, ic_tar = 0; |
392 | 394 | ||
393 | /* Disable the adapter */ | 395 | /* Disable the adapter */ |
394 | __i2c_dw_enable(dev, false); | 396 | __i2c_dw_enable(dev, false); |
395 | 397 | ||
396 | /* set the slave (target) address */ | ||
397 | dw_writel(dev, msgs[dev->msg_write_idx].addr, DW_IC_TAR); | ||
398 | |||
399 | /* if the slave address is ten bit address, enable 10BITADDR */ | 398 | /* if the slave address is ten bit address, enable 10BITADDR */ |
400 | ic_con = dw_readl(dev, DW_IC_CON); | 399 | ic_con = dw_readl(dev, DW_IC_CON); |
401 | if (msgs[dev->msg_write_idx].flags & I2C_M_TEN) | 400 | if (msgs[dev->msg_write_idx].flags & I2C_M_TEN) { |
402 | ic_con |= DW_IC_CON_10BITADDR_MASTER; | 401 | ic_con |= DW_IC_CON_10BITADDR_MASTER; |
403 | else | 402 | /* |
403 | * If I2C_DYNAMIC_TAR_UPDATE is set, the 10-bit addressing | ||
404 | * mode has to be enabled via bit 12 of IC_TAR register. | ||
405 | * We set it always as I2C_DYNAMIC_TAR_UPDATE can't be | ||
406 | * detected from registers. | ||
407 | */ | ||
408 | ic_tar = DW_IC_TAR_10BITADDR_MASTER; | ||
409 | } else { | ||
404 | ic_con &= ~DW_IC_CON_10BITADDR_MASTER; | 410 | ic_con &= ~DW_IC_CON_10BITADDR_MASTER; |
411 | } | ||
412 | |||
405 | dw_writel(dev, ic_con, DW_IC_CON); | 413 | dw_writel(dev, ic_con, DW_IC_CON); |
406 | 414 | ||
415 | /* | ||
416 | * Set the slave (target) address and enable 10-bit addressing mode | ||
417 | * if applicable. | ||
418 | */ | ||
419 | dw_writel(dev, msgs[dev->msg_write_idx].addr | ic_tar, DW_IC_TAR); | ||
420 | |||
407 | /* Enable the adapter */ | 421 | /* Enable the adapter */ |
408 | __i2c_dw_enable(dev, true); | 422 | __i2c_dw_enable(dev, true); |
409 | 423 | ||
diff --git a/drivers/i2c/busses/i2c-designware-platdrv.c b/drivers/i2c/busses/i2c-designware-platdrv.c index 4c1b60539a25..0aa01136f8d9 100644 --- a/drivers/i2c/busses/i2c-designware-platdrv.c +++ b/drivers/i2c/busses/i2c-designware-platdrv.c | |||
@@ -270,7 +270,8 @@ static SIMPLE_DEV_PM_OPS(dw_i2c_dev_pm_ops, dw_i2c_suspend, dw_i2c_resume); | |||
270 | MODULE_ALIAS("platform:i2c_designware"); | 270 | MODULE_ALIAS("platform:i2c_designware"); |
271 | 271 | ||
272 | static struct platform_driver dw_i2c_driver = { | 272 | static struct platform_driver dw_i2c_driver = { |
273 | .remove = dw_i2c_remove, | 273 | .probe = dw_i2c_probe, |
274 | .remove = dw_i2c_remove, | ||
274 | .driver = { | 275 | .driver = { |
275 | .name = "i2c_designware", | 276 | .name = "i2c_designware", |
276 | .owner = THIS_MODULE, | 277 | .owner = THIS_MODULE, |
@@ -282,7 +283,7 @@ static struct platform_driver dw_i2c_driver = { | |||
282 | 283 | ||
283 | static int __init dw_i2c_init_driver(void) | 284 | static int __init dw_i2c_init_driver(void) |
284 | { | 285 | { |
285 | return platform_driver_probe(&dw_i2c_driver, dw_i2c_probe); | 286 | return platform_driver_register(&dw_i2c_driver); |
286 | } | 287 | } |
287 | subsys_initcall(dw_i2c_init_driver); | 288 | subsys_initcall(dw_i2c_init_driver); |
288 | 289 | ||
diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index ccf46656bdad..1d7efa3169cd 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c | |||
@@ -365,7 +365,7 @@ static void i2c_imx_stop(struct imx_i2c_struct *i2c_imx) | |||
365 | clk_disable_unprepare(i2c_imx->clk); | 365 | clk_disable_unprepare(i2c_imx->clk); |
366 | } | 366 | } |
367 | 367 | ||
368 | static void __init i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, | 368 | static void i2c_imx_set_clk(struct imx_i2c_struct *i2c_imx, |
369 | unsigned int rate) | 369 | unsigned int rate) |
370 | { | 370 | { |
371 | struct imx_i2c_clk_pair *i2c_clk_div = i2c_imx->hwdata->clk_div; | 371 | struct imx_i2c_clk_pair *i2c_clk_div = i2c_imx->hwdata->clk_div; |
@@ -589,7 +589,7 @@ static struct i2c_algorithm i2c_imx_algo = { | |||
589 | .functionality = i2c_imx_func, | 589 | .functionality = i2c_imx_func, |
590 | }; | 590 | }; |
591 | 591 | ||
592 | static int __init i2c_imx_probe(struct platform_device *pdev) | 592 | static int i2c_imx_probe(struct platform_device *pdev) |
593 | { | 593 | { |
594 | const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids, | 594 | const struct of_device_id *of_id = of_match_device(i2c_imx_dt_ids, |
595 | &pdev->dev); | 595 | &pdev->dev); |
@@ -697,7 +697,7 @@ static int __init i2c_imx_probe(struct platform_device *pdev) | |||
697 | return 0; /* Return OK */ | 697 | return 0; /* Return OK */ |
698 | } | 698 | } |
699 | 699 | ||
700 | static int __exit i2c_imx_remove(struct platform_device *pdev) | 700 | static int i2c_imx_remove(struct platform_device *pdev) |
701 | { | 701 | { |
702 | struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev); | 702 | struct imx_i2c_struct *i2c_imx = platform_get_drvdata(pdev); |
703 | 703 | ||
@@ -715,7 +715,8 @@ static int __exit i2c_imx_remove(struct platform_device *pdev) | |||
715 | } | 715 | } |
716 | 716 | ||
717 | static struct platform_driver i2c_imx_driver = { | 717 | static struct platform_driver i2c_imx_driver = { |
718 | .remove = __exit_p(i2c_imx_remove), | 718 | .probe = i2c_imx_probe, |
719 | .remove = i2c_imx_remove, | ||
719 | .driver = { | 720 | .driver = { |
720 | .name = DRIVER_NAME, | 721 | .name = DRIVER_NAME, |
721 | .owner = THIS_MODULE, | 722 | .owner = THIS_MODULE, |
@@ -726,7 +727,7 @@ static struct platform_driver i2c_imx_driver = { | |||
726 | 727 | ||
727 | static int __init i2c_adap_imx_init(void) | 728 | static int __init i2c_adap_imx_init(void) |
728 | { | 729 | { |
729 | return platform_driver_probe(&i2c_imx_driver, i2c_imx_probe); | 730 | return platform_driver_register(&i2c_imx_driver); |
730 | } | 731 | } |
731 | subsys_initcall(i2c_adap_imx_init); | 732 | subsys_initcall(i2c_adap_imx_init); |
732 | 733 | ||
diff --git a/drivers/i2c/busses/i2c-ismt.c b/drivers/i2c/busses/i2c-ismt.c index 8ed79a086f85..1672effbcebb 100644 --- a/drivers/i2c/busses/i2c-ismt.c +++ b/drivers/i2c/busses/i2c-ismt.c | |||
@@ -393,6 +393,9 @@ static int ismt_access(struct i2c_adapter *adap, u16 addr, | |||
393 | 393 | ||
394 | desc = &priv->hw[priv->head]; | 394 | desc = &priv->hw[priv->head]; |
395 | 395 | ||
396 | /* Initialize the DMA buffer */ | ||
397 | memset(priv->dma_buffer, 0, sizeof(priv->dma_buffer)); | ||
398 | |||
396 | /* Initialize the descriptor */ | 399 | /* Initialize the descriptor */ |
397 | memset(desc, 0, sizeof(struct ismt_desc)); | 400 | memset(desc, 0, sizeof(struct ismt_desc)); |
398 | desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write); | 401 | desc->tgtaddr_rw = ISMT_DESC_ADDR_RW(addr, read_write); |
diff --git a/drivers/i2c/busses/i2c-mv64xxx.c b/drivers/i2c/busses/i2c-mv64xxx.c index 7f3a47443494..d3e9cc3153a9 100644 --- a/drivers/i2c/busses/i2c-mv64xxx.c +++ b/drivers/i2c/busses/i2c-mv64xxx.c | |||
@@ -234,9 +234,9 @@ static int mv64xxx_i2c_offload_msg(struct mv64xxx_i2c_data *drv_data) | |||
234 | ctrl_reg |= MV64XXX_I2C_BRIDGE_CONTROL_WR | | 234 | ctrl_reg |= MV64XXX_I2C_BRIDGE_CONTROL_WR | |
235 | (msg->len - 1) << MV64XXX_I2C_BRIDGE_CONTROL_TX_SIZE_SHIFT; | 235 | (msg->len - 1) << MV64XXX_I2C_BRIDGE_CONTROL_TX_SIZE_SHIFT; |
236 | 236 | ||
237 | writel_relaxed(data_reg_lo, | 237 | writel(data_reg_lo, |
238 | drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_LO); | 238 | drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_LO); |
239 | writel_relaxed(data_reg_hi, | 239 | writel(data_reg_hi, |
240 | drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_HI); | 240 | drv_data->reg_base + MV64XXX_I2C_REG_TX_DATA_HI); |
241 | 241 | ||
242 | } else { | 242 | } else { |
@@ -697,6 +697,7 @@ static const struct of_device_id mv64xxx_i2c_of_match_table[] = { | |||
697 | MODULE_DEVICE_TABLE(of, mv64xxx_i2c_of_match_table); | 697 | MODULE_DEVICE_TABLE(of, mv64xxx_i2c_of_match_table); |
698 | 698 | ||
699 | #ifdef CONFIG_OF | 699 | #ifdef CONFIG_OF |
700 | #ifdef CONFIG_HAVE_CLK | ||
700 | static int | 701 | static int |
701 | mv64xxx_calc_freq(const int tclk, const int n, const int m) | 702 | mv64xxx_calc_freq(const int tclk, const int n, const int m) |
702 | { | 703 | { |
@@ -726,16 +727,12 @@ mv64xxx_find_baud_factors(const u32 req_freq, const u32 tclk, u32 *best_n, | |||
726 | return false; | 727 | return false; |
727 | return true; | 728 | return true; |
728 | } | 729 | } |
730 | #endif /* CONFIG_HAVE_CLK */ | ||
729 | 731 | ||
730 | static int | 732 | static int |
731 | mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data, | 733 | mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data, |
732 | struct device *dev) | 734 | struct device *dev) |
733 | { | 735 | { |
734 | const struct of_device_id *device; | ||
735 | struct device_node *np = dev->of_node; | ||
736 | u32 bus_freq, tclk; | ||
737 | int rc = 0; | ||
738 | |||
739 | /* CLK is mandatory when using DT to describe the i2c bus. We | 736 | /* CLK is mandatory when using DT to describe the i2c bus. We |
740 | * need to know tclk in order to calculate bus clock | 737 | * need to know tclk in order to calculate bus clock |
741 | * factors. | 738 | * factors. |
@@ -744,6 +741,11 @@ mv64xxx_of_config(struct mv64xxx_i2c_data *drv_data, | |||
744 | /* Have OF but no CLK */ | 741 | /* Have OF but no CLK */ |
745 | return -ENODEV; | 742 | return -ENODEV; |
746 | #else | 743 | #else |
744 | const struct of_device_id *device; | ||
745 | struct device_node *np = dev->of_node; | ||
746 | u32 bus_freq, tclk; | ||
747 | int rc = 0; | ||
748 | |||
747 | if (IS_ERR(drv_data->clk)) { | 749 | if (IS_ERR(drv_data->clk)) { |
748 | rc = -ENODEV; | 750 | rc = -ENODEV; |
749 | goto out; | 751 | goto out; |
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c index f4a01675fa71..b7c857774708 100644 --- a/drivers/i2c/busses/i2c-mxs.c +++ b/drivers/i2c/busses/i2c-mxs.c | |||
@@ -780,12 +780,13 @@ static struct platform_driver mxs_i2c_driver = { | |||
780 | .owner = THIS_MODULE, | 780 | .owner = THIS_MODULE, |
781 | .of_match_table = mxs_i2c_dt_ids, | 781 | .of_match_table = mxs_i2c_dt_ids, |
782 | }, | 782 | }, |
783 | .probe = mxs_i2c_probe, | ||
783 | .remove = mxs_i2c_remove, | 784 | .remove = mxs_i2c_remove, |
784 | }; | 785 | }; |
785 | 786 | ||
786 | static int __init mxs_i2c_init(void) | 787 | static int __init mxs_i2c_init(void) |
787 | { | 788 | { |
788 | return platform_driver_probe(&mxs_i2c_driver, mxs_i2c_probe); | 789 | return platform_driver_register(&mxs_i2c_driver); |
789 | } | 790 | } |
790 | subsys_initcall(mxs_i2c_init); | 791 | subsys_initcall(mxs_i2c_init); |
791 | 792 | ||
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c index 6d8308d5dc4e..9967a6f9c2ff 100644 --- a/drivers/i2c/busses/i2c-omap.c +++ b/drivers/i2c/busses/i2c-omap.c | |||
@@ -939,6 +939,9 @@ omap_i2c_isr_thread(int this_irq, void *dev_id) | |||
939 | /* | 939 | /* |
940 | * ProDB0017052: Clear ARDY bit twice | 940 | * ProDB0017052: Clear ARDY bit twice |
941 | */ | 941 | */ |
942 | if (stat & OMAP_I2C_STAT_ARDY) | ||
943 | omap_i2c_ack_stat(dev, OMAP_I2C_STAT_ARDY); | ||
944 | |||
942 | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | | 945 | if (stat & (OMAP_I2C_STAT_ARDY | OMAP_I2C_STAT_NACK | |
943 | OMAP_I2C_STAT_AL)) { | 946 | OMAP_I2C_STAT_AL)) { |
944 | omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_RRDY | | 947 | omap_i2c_ack_stat(dev, (OMAP_I2C_STAT_RRDY | |
diff --git a/drivers/i2c/busses/i2c-s3c2410.c b/drivers/i2c/busses/i2c-s3c2410.c index 3535f3c0f7b4..3747b9bf67d6 100644 --- a/drivers/i2c/busses/i2c-s3c2410.c +++ b/drivers/i2c/busses/i2c-s3c2410.c | |||
@@ -1178,8 +1178,6 @@ static int s3c24xx_i2c_remove(struct platform_device *pdev) | |||
1178 | 1178 | ||
1179 | i2c_del_adapter(&i2c->adap); | 1179 | i2c_del_adapter(&i2c->adap); |
1180 | 1180 | ||
1181 | clk_disable_unprepare(i2c->clk); | ||
1182 | |||
1183 | if (pdev->dev.of_node && IS_ERR(i2c->pctrl)) | 1181 | if (pdev->dev.of_node && IS_ERR(i2c->pctrl)) |
1184 | s3c24xx_i2c_dt_gpio_free(i2c); | 1182 | s3c24xx_i2c_dt_gpio_free(i2c); |
1185 | 1183 | ||
diff --git a/drivers/i2c/busses/i2c-stu300.c b/drivers/i2c/busses/i2c-stu300.c index f8f6f2e552db..04a17b9b38bb 100644 --- a/drivers/i2c/busses/i2c-stu300.c +++ b/drivers/i2c/busses/i2c-stu300.c | |||
@@ -859,8 +859,7 @@ static const struct i2c_algorithm stu300_algo = { | |||
859 | .functionality = stu300_func, | 859 | .functionality = stu300_func, |
860 | }; | 860 | }; |
861 | 861 | ||
862 | static int __init | 862 | static int stu300_probe(struct platform_device *pdev) |
863 | stu300_probe(struct platform_device *pdev) | ||
864 | { | 863 | { |
865 | struct stu300_dev *dev; | 864 | struct stu300_dev *dev; |
866 | struct i2c_adapter *adap; | 865 | struct i2c_adapter *adap; |
@@ -966,8 +965,7 @@ static SIMPLE_DEV_PM_OPS(stu300_pm, stu300_suspend, stu300_resume); | |||
966 | #define STU300_I2C_PM NULL | 965 | #define STU300_I2C_PM NULL |
967 | #endif | 966 | #endif |
968 | 967 | ||
969 | static int __exit | 968 | static int stu300_remove(struct platform_device *pdev) |
970 | stu300_remove(struct platform_device *pdev) | ||
971 | { | 969 | { |
972 | struct stu300_dev *dev = platform_get_drvdata(pdev); | 970 | struct stu300_dev *dev = platform_get_drvdata(pdev); |
973 | 971 | ||
@@ -989,13 +987,14 @@ static struct platform_driver stu300_i2c_driver = { | |||
989 | .pm = STU300_I2C_PM, | 987 | .pm = STU300_I2C_PM, |
990 | .of_match_table = stu300_dt_match, | 988 | .of_match_table = stu300_dt_match, |
991 | }, | 989 | }, |
992 | .remove = __exit_p(stu300_remove), | 990 | .probe = stu300_probe, |
991 | .remove = stu300_remove, | ||
993 | 992 | ||
994 | }; | 993 | }; |
995 | 994 | ||
996 | static int __init stu300_init(void) | 995 | static int __init stu300_init(void) |
997 | { | 996 | { |
998 | return platform_driver_probe(&stu300_i2c_driver, stu300_probe); | 997 | return platform_driver_register(&stu300_i2c_driver); |
999 | } | 998 | } |
1000 | 999 | ||
1001 | static void __exit stu300_exit(void) | 1000 | static void __exit stu300_exit(void) |
diff --git a/drivers/i2c/i2c-core.c b/drivers/i2c/i2c-core.c index 29d3f045a2bf..3be58f89ac77 100644 --- a/drivers/i2c/i2c-core.c +++ b/drivers/i2c/i2c-core.c | |||
@@ -1134,6 +1134,9 @@ static void acpi_i2c_register_devices(struct i2c_adapter *adap) | |||
1134 | acpi_handle handle; | 1134 | acpi_handle handle; |
1135 | acpi_status status; | 1135 | acpi_status status; |
1136 | 1136 | ||
1137 | if (!adap->dev.parent) | ||
1138 | return; | ||
1139 | |||
1137 | handle = ACPI_HANDLE(adap->dev.parent); | 1140 | handle = ACPI_HANDLE(adap->dev.parent); |
1138 | if (!handle) | 1141 | if (!handle) |
1139 | return; | 1142 | return; |
diff --git a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c index 74b41ae690f3..928656e241dd 100644 --- a/drivers/i2c/muxes/i2c-arb-gpio-challenge.c +++ b/drivers/i2c/muxes/i2c-arb-gpio-challenge.c | |||
@@ -200,7 +200,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev) | |||
200 | arb->parent = of_find_i2c_adapter_by_node(parent_np); | 200 | arb->parent = of_find_i2c_adapter_by_node(parent_np); |
201 | if (!arb->parent) { | 201 | if (!arb->parent) { |
202 | dev_err(dev, "Cannot find parent bus\n"); | 202 | dev_err(dev, "Cannot find parent bus\n"); |
203 | return -EINVAL; | 203 | return -EPROBE_DEFER; |
204 | } | 204 | } |
205 | 205 | ||
206 | /* Actually add the mux adapter */ | 206 | /* Actually add the mux adapter */ |
diff --git a/drivers/i2c/muxes/i2c-mux-gpio.c b/drivers/i2c/muxes/i2c-mux-gpio.c index 5d4a99ba743e..a764da777f08 100644 --- a/drivers/i2c/muxes/i2c-mux-gpio.c +++ b/drivers/i2c/muxes/i2c-mux-gpio.c | |||
@@ -66,7 +66,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, | |||
66 | struct device_node *adapter_np, *child; | 66 | struct device_node *adapter_np, *child; |
67 | struct i2c_adapter *adapter; | 67 | struct i2c_adapter *adapter; |
68 | unsigned *values, *gpios; | 68 | unsigned *values, *gpios; |
69 | int i = 0; | 69 | int i = 0, ret; |
70 | 70 | ||
71 | if (!np) | 71 | if (!np) |
72 | return -ENODEV; | 72 | return -ENODEV; |
@@ -79,7 +79,7 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, | |||
79 | adapter = of_find_i2c_adapter_by_node(adapter_np); | 79 | adapter = of_find_i2c_adapter_by_node(adapter_np); |
80 | if (!adapter) { | 80 | if (!adapter) { |
81 | dev_err(&pdev->dev, "Cannot find parent bus\n"); | 81 | dev_err(&pdev->dev, "Cannot find parent bus\n"); |
82 | return -ENODEV; | 82 | return -EPROBE_DEFER; |
83 | } | 83 | } |
84 | mux->data.parent = i2c_adapter_id(adapter); | 84 | mux->data.parent = i2c_adapter_id(adapter); |
85 | put_device(&adapter->dev); | 85 | put_device(&adapter->dev); |
@@ -116,8 +116,12 @@ static int i2c_mux_gpio_probe_dt(struct gpiomux *mux, | |||
116 | return -ENOMEM; | 116 | return -ENOMEM; |
117 | } | 117 | } |
118 | 118 | ||
119 | for (i = 0; i < mux->data.n_gpios; i++) | 119 | for (i = 0; i < mux->data.n_gpios; i++) { |
120 | gpios[i] = of_get_named_gpio(np, "mux-gpios", i); | 120 | ret = of_get_named_gpio(np, "mux-gpios", i); |
121 | if (ret < 0) | ||
122 | return ret; | ||
123 | gpios[i] = ret; | ||
124 | } | ||
121 | 125 | ||
122 | mux->data.gpios = gpios; | 126 | mux->data.gpios = gpios; |
123 | 127 | ||
@@ -177,7 +181,7 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev) | |||
177 | if (!parent) { | 181 | if (!parent) { |
178 | dev_err(&pdev->dev, "Parent adapter (%d) not found\n", | 182 | dev_err(&pdev->dev, "Parent adapter (%d) not found\n", |
179 | mux->data.parent); | 183 | mux->data.parent); |
180 | return -ENODEV; | 184 | return -EPROBE_DEFER; |
181 | } | 185 | } |
182 | 186 | ||
183 | mux->parent = parent; | 187 | mux->parent = parent; |
diff --git a/drivers/i2c/muxes/i2c-mux-pinctrl.c b/drivers/i2c/muxes/i2c-mux-pinctrl.c index 69a91732ae65..68a37157377d 100644 --- a/drivers/i2c/muxes/i2c-mux-pinctrl.c +++ b/drivers/i2c/muxes/i2c-mux-pinctrl.c | |||
@@ -113,7 +113,7 @@ static int i2c_mux_pinctrl_parse_dt(struct i2c_mux_pinctrl *mux, | |||
113 | adapter = of_find_i2c_adapter_by_node(adapter_np); | 113 | adapter = of_find_i2c_adapter_by_node(adapter_np); |
114 | if (!adapter) { | 114 | if (!adapter) { |
115 | dev_err(mux->dev, "Cannot find parent bus\n"); | 115 | dev_err(mux->dev, "Cannot find parent bus\n"); |
116 | return -ENODEV; | 116 | return -EPROBE_DEFER; |
117 | } | 117 | } |
118 | mux->pdata->parent_bus_num = i2c_adapter_id(adapter); | 118 | mux->pdata->parent_bus_num = i2c_adapter_id(adapter); |
119 | put_device(&adapter->dev); | 119 | put_device(&adapter->dev); |
@@ -211,7 +211,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev) | |||
211 | if (!mux->parent) { | 211 | if (!mux->parent) { |
212 | dev_err(&pdev->dev, "Parent adapter (%d) not found\n", | 212 | dev_err(&pdev->dev, "Parent adapter (%d) not found\n", |
213 | mux->pdata->parent_bus_num); | 213 | mux->pdata->parent_bus_num); |
214 | ret = -ENODEV; | 214 | ret = -EPROBE_DEFER; |
215 | goto err; | 215 | goto err; |
216 | } | 216 | } |
217 | 217 | ||