From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 551CAC64E7A for ; Tue, 1 Dec 2020 13:57:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 0701F206A5 for ; Tue, 1 Dec 2020 13:57:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387587AbgLAN5D (ORCPT ); Tue, 1 Dec 2020 08:57:03 -0500 Received: from honk.sigxcpu.org ([24.134.29.49]:46176 "EHLO honk.sigxcpu.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727132AbgLAN5D (ORCPT ); Tue, 1 Dec 2020 08:57:03 -0500 Received: from localhost (localhost [127.0.0.1]) by honk.sigxcpu.org (Postfix) with ESMTP id C914BFB03; Tue, 1 Dec 2020 14:56:21 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at honk.sigxcpu.org Received: from honk.sigxcpu.org ([127.0.0.1]) by localhost (honk.sigxcpu.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 6vslrzR7idRW; Tue, 1 Dec 2020 14:56:20 +0100 (CET) Received: by bogon.sigxcpu.org (Postfix, from userid 1000) id 85BED4068E; Tue, 1 Dec 2020 14:56:20 +0100 (CET) Date: Tue, 1 Dec 2020 14:56:20 +0100 From: Guido =?iso-8859-1?Q?G=FCnther?= To: Andy Shevchenko Cc: Heikki Krogerus , Greg Kroah-Hartman , USB , Linux Kernel Mailing List Subject: Re: [PATCH v4 2/2] usb: typec: tps6598x: Export some power supply properties Message-ID: <20201201135620.GA306177@bogon.m.sigxcpu.org> References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-usb@vger.kernel.org Hi Andy, On Tue, Dec 01, 2020 at 03:52:40PM +0200, Andy Shevchenko wrote: > On Tue, Dec 1, 2020 at 2:59 PM Guido Günther wrote: > > This allows downstream supplies and userspace to detect > > whether external power is supplied. > > ... > > > +static int devm_tps6598_psy_register(struct tps6598x *tps) > > +{ > > + struct power_supply_config psy_cfg = {}; > > + const char *port_dev_name = dev_name(tps->dev); > > > + size_t psy_name_len = strlen(tps6598x_psy_name_prefix) + > > + strlen(port_dev_name) + 1; > > I'm so sorry by not noticing this one... > > > + char *psy_name; > > + > > + psy_cfg.drv_data = tps; > > + psy_cfg.fwnode = dev_fwnode(tps->dev); > > + psy_name = devm_kzalloc(tps->dev, psy_name_len, GFP_KERNEL); > > + if (!psy_name) > > + return -ENOMEM; > > + > > + snprintf(psy_name, psy_name_len, "%s%s", tps6598x_psy_name_prefix, > > + port_dev_name); > > ...followed by this. > > Please, use devm_kasprintf() instead. Will do. I'll let the series sit for a couple of days before sending a v5. Cheers, -- Guido > > -- > With Best Regards, > Andy Shevchenko >