From patchwork Thu Jun 15 04:41:08 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tony Lindgren X-Patchwork-Id: 9788041 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id ABD6D60348 for ; Thu, 15 Jun 2017 04:48:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 96CBA28562 for ; Thu, 15 Jun 2017 04:48:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8B7A328573; Thu, 15 Jun 2017 04:48:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E830528562 for ; Thu, 15 Jun 2017 04:48:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750808AbdFOEsO (ORCPT ); Thu, 15 Jun 2017 00:48:14 -0400 Received: from muru.com ([72.249.23.125]:51864 "EHLO muru.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750776AbdFOEsN (ORCPT ); Thu, 15 Jun 2017 00:48:13 -0400 Received: from sampyla.muru.com (localhost [127.0.0.1]) by muru.com (Postfix) with ESMTP id 3194980F9; Thu, 15 Jun 2017 04:45:02 +0000 (UTC) From: Tony Lindgren To: Sebastian Reichel Cc: linux-pm@vger.kernel.org, linux-omap@vger.kernel.org, Marcel Partap , Michael Scott Subject: [PATCH] power: supply: cpcap-charger: Add missing power_supply_config Date: Wed, 14 Jun 2017 21:41:08 -0700 Message-Id: <20170615044108.26707-1-tony@atomide.com> X-Mailer: git-send-email 2.13.0 Sender: linux-pm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Cc: Michael Scott Signed-off-by: Tony Lindgren --- 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",