Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp49024pxu; Tue, 1 Dec 2020 05:58:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwpN26vuQWKE+qTRd6lkTO9+7/uZqLbL/cOEBxn29ounc8mKb/vHBJAjS88Tz7jIs8HsHC X-Received: by 2002:a50:bf4a:: with SMTP id g10mr3167662edk.288.1606831136306; Tue, 01 Dec 2020 05:58:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606831136; cv=none; d=google.com; s=arc-20160816; b=qsi8qpFUWqHrNgON/Hltl6RLrRvq7NGINLUoaYPId+4jPA23S/xiUIxLgcuVXH8v0s ICOBiZutCmeCw5FiY0MbvcPNL3FxrC5VZIki87UfQj3WRoWgK+KFuHk/4fv2czjr3bDm mHM45VXl9+QXq7t8h4iFo7zP77fjwIw8j3rp7i8hsauL/6f2ZPEr6MXHPvFxTQmf7VXB 887L4QLPIFa4UMxBvf6EPClj1+OEGLNOg+n28vJGv1Cn/3vVx1tcTM4JK8a2wD7CtEF0 Gt0G7lIbP1mkf31X4Pdo5f3dDHsx6Vdek+Kdm4dOhqD7kwMPSdh6CmlRgxvSDmgKwVcN g01g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=FmnC831U9yd6ZndpIfAv8MZYq40bQ9bWSJ1EQ7Q/c5k=; b=qlhvuMXqh/mNybL5HA/xKWHV66Ketfn8bOQHifletHErEGGWBfFXJl0nG/DSdECMoB XySJM9Kl5ddmtG/lNcKOjnnEbodKjhfYKRfJH4DFElDfGB0f1eSh+WnQih0UkOofWe4Q AeDE+1pTprEUDgskwfw5QpLsYcICkkxQg1Tjr4xbmQHq96lHuMIwdmlzIINTZAH+Gu/s bxCr0Vi0lptxdyEGyMZsCGlGa3iprmqfO66YEqdk9QaKgJI/oUt0X63ML3jjts1p+YXH ZMeu9n79qR2Q2S15kCo7L+2i8B2lcVoIeKTKJDMarGLtx9/iacx8vAOopVK7q5I8KC+D akUQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si1234453edc.196.2020.12.01.05.58.33; Tue, 01 Dec 2020 05:58:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388266AbgLAN5D (ORCPT + 99 others); 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-kernel@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 >