mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-11 00:08:50 +00:00
power: supply: cpcap-charger: Add missing power_supply_config
Otherwise cpcap-battery won't probe properly with the power-supplies property configured but will fail with "Not all required supplies found, defer probe". Cc: Marcel Partap <mpartap@gmx.net> Cc: Michael Scott <michael.scott@linaro.org> Signed-off-by: Tony Lindgren <tony@atomide.com> Signed-off-by: Sebastian Reichel <sebastian.reichel@collabora.co.uk>
This commit is contained in:
parent
5e6eb025b0
commit
fc44313830
@ -601,6 +601,7 @@ static int cpcap_charger_probe(struct platform_device *pdev)
|
|||||||
{
|
{
|
||||||
struct cpcap_charger_ddata *ddata;
|
struct cpcap_charger_ddata *ddata;
|
||||||
const struct of_device_id *of_id;
|
const struct of_device_id *of_id;
|
||||||
|
struct power_supply_config psy_cfg = {};
|
||||||
int error;
|
int error;
|
||||||
|
|
||||||
of_id = of_match_device(of_match_ptr(cpcap_charger_id_table),
|
of_id = of_match_device(of_match_ptr(cpcap_charger_id_table),
|
||||||
@ -629,9 +630,12 @@ static int cpcap_charger_probe(struct platform_device *pdev)
|
|||||||
|
|
||||||
atomic_set(&ddata->active, 1);
|
atomic_set(&ddata->active, 1);
|
||||||
|
|
||||||
|
psy_cfg.of_node = pdev->dev.of_node;
|
||||||
|
psy_cfg.drv_data = ddata;
|
||||||
|
|
||||||
ddata->usb = devm_power_supply_register(ddata->dev,
|
ddata->usb = devm_power_supply_register(ddata->dev,
|
||||||
&cpcap_charger_usb_desc,
|
&cpcap_charger_usb_desc,
|
||||||
NULL);
|
&psy_cfg);
|
||||||
if (IS_ERR(ddata->usb)) {
|
if (IS_ERR(ddata->usb)) {
|
||||||
error = PTR_ERR(ddata->usb);
|
error = PTR_ERR(ddata->usb);
|
||||||
dev_err(ddata->dev, "failed to register USB charger: %i\n",
|
dev_err(ddata->dev, "failed to register USB charger: %i\n",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user