Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux

Pull i2c fixes from Wolfram Sang:
"Mostly slight adjusments for new drivers, but also one core fix for
which finally the dependencies are now available as well"

* 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
i2c: Mark instantiated device nodes with OF_POPULATE
i2c: jz4780: Fix return value if probe fails
i2c: xgene-slimpro: Fix missing mbox_free_channel call in probe error path
i2c: I2C_MT65XX should depend on HAS_DMA

+25 -8
+1
drivers/i2c/busses/Kconfig
··· 633 633 config I2C_MT65XX 634 634 tristate "MediaTek I2C adapter" 635 635 depends on ARCH_MEDIATEK || COMPILE_TEST 636 + depends on HAS_DMA 636 637 help 637 638 This selects the MediaTek(R) Integrated Inter Circuit bus driver 638 639 for MT65xx and MT81xx.
+8 -7
drivers/i2c/busses/i2c-jz4780.c
··· 764 764 if (IS_ERR(i2c->clk)) 765 765 return PTR_ERR(i2c->clk); 766 766 767 - clk_prepare_enable(i2c->clk); 767 + ret = clk_prepare_enable(i2c->clk); 768 + if (ret) 769 + return ret; 768 770 769 - if (of_property_read_u32(pdev->dev.of_node, "clock-frequency", 770 - &clk_freq)) { 771 + ret = of_property_read_u32(pdev->dev.of_node, "clock-frequency", 772 + &clk_freq); 773 + if (ret) { 771 774 dev_err(&pdev->dev, "clock-frequency not specified in DT"); 772 - return clk_freq; 775 + goto err; 773 776 } 774 777 775 778 i2c->speed = clk_freq / 1000; ··· 793 790 i2c->irq = platform_get_irq(pdev, 0); 794 791 ret = devm_request_irq(&pdev->dev, i2c->irq, jz4780_i2c_irq, 0, 795 792 dev_name(&pdev->dev), i2c); 796 - if (ret) { 797 - ret = -ENODEV; 793 + if (ret) 798 794 goto err; 799 - } 800 795 801 796 ret = i2c_add_adapter(&i2c->adap); 802 797 if (ret < 0) {
+1
drivers/i2c/busses/i2c-xgene-slimpro.c
··· 419 419 rc = i2c_add_adapter(adapter); 420 420 if (rc) { 421 421 dev_err(&pdev->dev, "Adapter registeration failed\n"); 422 + mbox_free_channel(ctx->mbox_chan); 422 423 return rc; 423 424 } 424 425
+15 -1
drivers/i2c/i2c-core.c
··· 1012 1012 */ 1013 1013 void i2c_unregister_device(struct i2c_client *client) 1014 1014 { 1015 + if (client->dev.of_node) 1016 + of_node_clear_flag(client->dev.of_node, OF_POPULATED); 1015 1017 device_unregister(&client->dev); 1016 1018 } 1017 1019 EXPORT_SYMBOL_GPL(i2c_unregister_device); ··· 1322 1320 1323 1321 dev_dbg(&adap->dev, "of_i2c: walking child nodes\n"); 1324 1322 1325 - for_each_available_child_of_node(adap->dev.of_node, node) 1323 + for_each_available_child_of_node(adap->dev.of_node, node) { 1324 + if (of_node_test_and_set_flag(node, OF_POPULATED)) 1325 + continue; 1326 1326 of_i2c_register_device(adap, node); 1327 + } 1327 1328 } 1328 1329 1329 1330 static int of_dev_node_match(struct device *dev, void *data) ··· 1858 1853 if (adap == NULL) 1859 1854 return NOTIFY_OK; /* not for us */ 1860 1855 1856 + if (of_node_test_and_set_flag(rd->dn, OF_POPULATED)) { 1857 + put_device(&adap->dev); 1858 + return NOTIFY_OK; 1859 + } 1860 + 1861 1861 client = of_i2c_register_device(adap, rd->dn); 1862 1862 put_device(&adap->dev); 1863 1863 ··· 1873 1863 } 1874 1864 break; 1875 1865 case OF_RECONFIG_CHANGE_REMOVE: 1866 + /* already depopulated? */ 1867 + if (!of_node_check_flag(rd->dn, OF_POPULATED)) 1868 + return NOTIFY_OK; 1869 + 1876 1870 /* find our device by node */ 1877 1871 client = of_find_i2c_device_by_node(rd->dn); 1878 1872 if (client == NULL)