linux-usb.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Guido Günther" <agx@sigxcpu.org>
To: Andy Shevchenko <andy.shevchenko@gmail.com>
Cc: Heikki Krogerus <heikki.krogerus@linux.intel.com>,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	USB <linux-usb@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v4 2/2] usb: typec: tps6598x: Export some power supply properties
Date: Tue, 1 Dec 2020 14:56:20 +0100	[thread overview]
Message-ID: <20201201135620.GA306177@bogon.m.sigxcpu.org> (raw)
In-Reply-To: <CAHp75VdwnGD+39AHusGvSKcnOZs7q_AfXniTBaA+J=yMqL4_nw@mail.gmail.com>

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 <agx@sigxcpu.org> 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
> 

  reply	other threads:[~2020-12-01 13:57 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-01 12:59 [PATCH v4 0/2] usb: typec: tps6598x: Export some power supply properties Guido Günther
2020-12-01 12:59 ` [PATCH v4 1/2] usb: typec: tps6598x: Select USB_ROLE_SWITCH and REGMAP_I2C Guido Günther
2020-12-01 12:59 ` [PATCH v4 2/2] usb: typec: tps6598x: Export some power supply properties Guido Günther
2020-12-01 13:52   ` Andy Shevchenko
2020-12-01 13:56     ` Guido Günther [this message]
2020-12-01 13:55 ` [PATCH v4 0/2] " Andy Shevchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201201135620.GA306177@bogon.m.sigxcpu.org \
    --to=agx@sigxcpu.org \
    --cc=andy.shevchenko@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=heikki.krogerus@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).