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

Merge tag 'for-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply

Pull power supply fixes from Reichel:
"I have two more fixes for the power-supply subsystem:

- two fixes for twl4030-charger"

* tag 'for-v4.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-power-supply:
power: supply: twl4030-charger: add deferred probing for phy and iio
power: supply: twl4030-charger: move irq allocation to just before irqs are enabled

+28 -15
+28 -15
drivers/power/supply/twl4030_charger.c
··· 980 980 981 981 platform_set_drvdata(pdev, bci); 982 982 983 + INIT_WORK(&bci->work, twl4030_bci_usb_work); 984 + INIT_DELAYED_WORK(&bci->current_worker, twl4030_current_worker); 985 + 983 986 bci->channel_vac = devm_iio_channel_get(&pdev->dev, "vac"); 984 987 if (IS_ERR(bci->channel_vac)) { 988 + ret = PTR_ERR(bci->channel_vac); 989 + if (ret == -EPROBE_DEFER) 990 + return ret; /* iio not ready */ 991 + dev_warn(&pdev->dev, "could not request vac iio channel (%d)", 992 + ret); 985 993 bci->channel_vac = NULL; 986 - dev_warn(&pdev->dev, "could not request vac iio channel"); 994 + } 995 + 996 + if (bci->dev->of_node) { 997 + struct device_node *phynode; 998 + 999 + phynode = of_find_compatible_node(bci->dev->of_node->parent, 1000 + NULL, "ti,twl4030-usb"); 1001 + if (phynode) { 1002 + bci->usb_nb.notifier_call = twl4030_bci_usb_ncb; 1003 + bci->transceiver = devm_usb_get_phy_by_node( 1004 + bci->dev, phynode, &bci->usb_nb); 1005 + if (IS_ERR(bci->transceiver)) { 1006 + ret = PTR_ERR(bci->transceiver); 1007 + if (ret == -EPROBE_DEFER) 1008 + return ret; /* phy not ready */ 1009 + dev_warn(&pdev->dev, "could not request transceiver (%d)", 1010 + ret); 1011 + bci->transceiver = NULL; 1012 + } 1013 + } 987 1014 } 988 1015 989 1016 bci->ac = devm_power_supply_register(&pdev->dev, &twl4030_bci_ac_desc, ··· 1044 1017 dev_err(&pdev->dev, "could not request irq %d, status %d\n", 1045 1018 bci->irq_bci, ret); 1046 1019 return ret; 1047 - } 1048 - 1049 - INIT_WORK(&bci->work, twl4030_bci_usb_work); 1050 - INIT_DELAYED_WORK(&bci->current_worker, twl4030_current_worker); 1051 - 1052 - bci->usb_nb.notifier_call = twl4030_bci_usb_ncb; 1053 - if (bci->dev->of_node) { 1054 - struct device_node *phynode; 1055 - 1056 - phynode = of_find_compatible_node(bci->dev->of_node->parent, 1057 - NULL, "ti,twl4030-usb"); 1058 - if (phynode) 1059 - bci->transceiver = devm_usb_get_phy_by_node( 1060 - bci->dev, phynode, &bci->usb_nb); 1061 1020 } 1062 1021 1063 1022 /* Enable interrupts now. */