All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] power: supply: cpcap-charger: Add missing power_supply_config
@ 2017-06-15  4:41 Tony Lindgren
  2017-06-15 12:55 ` Sebastian Reichel
  0 siblings, 1 reply; 2+ messages in thread
From: Tony Lindgren @ 2017-06-15  4:41 UTC (permalink / raw)
  To: Sebastian Reichel; +Cc: linux-pm, linux-omap, Marcel Partap, Michael Scott

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>
---
 drivers/power/supply/cpcap-charger.c | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
--- a/drivers/power/supply/cpcap-charger.c
+++ b/drivers/power/supply/cpcap-charger.c
@@ -637,6 +637,7 @@ static int cpcap_charger_probe(struct platform_device *pdev)
 {
 	struct cpcap_charger_ddata *ddata;
 	const struct of_device_id *of_id;
+	struct power_supply_config psy_cfg = {};
 	int error;
 
 	of_id = of_match_device(of_match_ptr(cpcap_charger_id_table),
@@ -665,9 +666,12 @@ static int cpcap_charger_probe(struct platform_device *pdev)
 
 	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,
 						&cpcap_charger_usb_desc,
-						NULL);
+						&psy_cfg);
 	if (IS_ERR(ddata->usb)) {
 		error = PTR_ERR(ddata->usb);
 		dev_err(ddata->dev, "failed to register USB charger: %i\n",
-- 
2.13.0

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] power: supply: cpcap-charger: Add missing power_supply_config
  2017-06-15  4:41 [PATCH] power: supply: cpcap-charger: Add missing power_supply_config Tony Lindgren
@ 2017-06-15 12:55 ` Sebastian Reichel
  0 siblings, 0 replies; 2+ messages in thread
From: Sebastian Reichel @ 2017-06-15 12:55 UTC (permalink / raw)
  To: Tony Lindgren; +Cc: linux-pm, linux-omap, Marcel Partap, Michael Scott

[-- Attachment #1: Type: text/plain, Size: 1504 bytes --]

Hi,

On Wed, Jun 14, 2017 at 09:41:08PM -0700, Tony Lindgren wrote:
> 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>

Thanks, queued.

-- Sebastian

> ---
>  drivers/power/supply/cpcap-charger.c | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
> --- a/drivers/power/supply/cpcap-charger.c
> +++ b/drivers/power/supply/cpcap-charger.c
> @@ -637,6 +637,7 @@ static int cpcap_charger_probe(struct platform_device *pdev)
>  {
>  	struct cpcap_charger_ddata *ddata;
>  	const struct of_device_id *of_id;
> +	struct power_supply_config psy_cfg = {};
>  	int error;
>  
>  	of_id = of_match_device(of_match_ptr(cpcap_charger_id_table),
> @@ -665,9 +666,12 @@ static int cpcap_charger_probe(struct platform_device *pdev)
>  
>  	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,
>  						&cpcap_charger_usb_desc,
> -						NULL);
> +						&psy_cfg);
>  	if (IS_ERR(ddata->usb)) {
>  		error = PTR_ERR(ddata->usb);
>  		dev_err(ddata->dev, "failed to register USB charger: %i\n",
> -- 
> 2.13.0

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-06-15 12:55 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-15  4:41 [PATCH] power: supply: cpcap-charger: Add missing power_supply_config Tony Lindgren
2017-06-15 12:55 ` Sebastian Reichel

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.