mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Thomas Weißschuh" <linux@weissschuh.net>
To: Douglas Gilbert <dgilbert@interlog.com>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Christophe JAILLET <christophe.jaillet@wanadoo.fr>,
	jdelvare@suse.com, linux-hwmon@vger.kernel.org,
	linux-kernel@vger.kernel.org, linux-usb@vger.kernel.org
Subject: Re: [PATCH v4] hwmon: add POWER-Z driver
Date: Sun, 3 Sep 2023 17:08:25 +0200	[thread overview]
Message-ID: <2743f7d5-9e8d-4a61-ba4a-d47bf26b6f62@t-8ch.de> (raw)
In-Reply-To: <7910a5e5-04f3-f585-e42d-4a0d7aa45f9d@interlog.com>

On 2023-09-03 10:54:06-0400, Douglas Gilbert wrote:
> On 2023-09-03 07:46, Guenter Roeck wrote:
> > On 9/2/23 22:54, Douglas Gilbert wrote:
> > > On 2023-09-02 18:56, Guenter Roeck wrote:
> > > > On 9/2/23 15:29, Thomas Weißschuh wrote:
> > > > > Hi,
> > > > > 
> > > > > On 2023-09-02 18:36:17+0200, Christophe JAILLET wrote:
> > > > > > Le 02/09/2023 à 09:47, Thomas Weißschuh a écrit :
> > > > > > > POWER-Z is a series of devices to monitor power characteristics of
> > > > > > > USB-C connections and display those on a on-device display.
> > > > > > > Some of the devices, notably KM002C and KM003C, contain an additional
> > > > > > > port which exposes the measurements via USB.
> > > > > > > 
> > > > > > > This is a driver for this monitor port.
> > > > > > > 
> > > > > > > It was developed and tested with the KM003C.
> > > > > > > 
> > > > > > > Signed-off-by: Thomas Weißschuh
> > > > > > > <linux-9XfqOkM5JgxKQ7RDE2T8Pw@public.gmane.org>
> > > > > > > ---
> > > > > > 
> > > > > > ...
> > > > > > 
> > > > > > > +static int powerz_probe(struct usb_interface *intf,
> > > > > > > +            const struct usb_device_id *id)
> > > > > > > +{
> > > > > > > +    struct powerz_priv *priv;
> > > > > > > +    struct device *hwmon_dev;
> > > > > > > +    struct device *parent;
> > > > > > > +
> > > > > > > +    parent = &intf->dev;
> > > > > > > +
> > > > > > > +    priv = devm_kzalloc(parent, sizeof(*priv), GFP_KERNEL);
> > > > > > > +    if (!priv)
> > > > > > > +        return -ENOMEM;
> > > > > > > +
> > > > > > > +    priv->urb = usb_alloc_urb(0, GFP_KERNEL);
> > > > > > > +    if (!priv->urb)
> > > > > > > +        return -ENOMEM;
> > > > > > > +    mutex_init(&priv->mutex);
> > > > > > > +    priv->status = -ETIMEDOUT;
> > > > > > > +    init_completion(&priv->completion);
> > > > > > > +
> > > > > > > +    hwmon_dev =
> > > > > > > +        devm_hwmon_device_register_with_info(parent, DRIVER_NAME, priv,
> > > > > > > +                         &powerz_chip_info, NULL);
> > > > > > > +    usb_set_intfdata(intf, priv);
> > > > > > > +
> > > > > > > +    return PTR_ERR_OR_ZERO(hwmon_dev);
> > > > > > 
> > > > > > Hi,
> > > > > > 
> > > > > > If 'hwmon_dev' is an PTR_ERR, priv->urb leaks.
> > > > > 
> > > > > Good catch, thanks!
> > > > > 
> > > > > 
> > > > > Guenter,
> > > > > 
> > > > > it seems the new hwmon-next with this driver has not yet been pushed to
> > > > > git.kernel.org, so I can't generate the Fixes tag.
> > > > > 
> > > > 
> > > > Rule is that I must not push anything into linux-next until
> > > > after v6.6-rc1 has been released.
> > > > 
> > > > > Can you modify the commit to also contain the changes below?
> > > > > Or let me know if you prefer something else.
> > > > > 
> > > > 
> > > > I'll update the patch and make the change.
> > > 
> > > Hi,
> > > While you are at it, you can make the driver detect the earlier model KM002C:
> > > 
> > 
> > Please send a separate patch to do that.
> 
> That would be easier if I could see a git repository with the powerz driver
> in it. Looking at:
>    https://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging.git/
> 
> or is there another url to use?

As mentioned by Guenter above this can only be pushed after 6.6-rc1 is
released which should be next weekend.

So let's wait until then. If you want I can take care of submitting the
KM002C patch when it's time.

Thanks for your testing!


Thomas

      reply	other threads:[~2023-09-03 15:08 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-02  7:47 Thomas Weißschuh
2023-09-02 14:10 ` Guenter Roeck
2023-09-02 14:20   ` Thomas Weißschuh
2023-09-02 16:36 ` Christophe JAILLET
2023-09-02 22:29   ` Thomas Weißschuh
2023-09-02 22:56     ` Guenter Roeck
2023-09-03  5:54       ` Douglas Gilbert
2023-09-03 11:46         ` Guenter Roeck
2023-09-03 14:54           ` Douglas Gilbert
2023-09-03 15:08             ` Thomas Weißschuh [this message]

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=2743f7d5-9e8d-4a61-ba4a-d47bf26b6f62@t-8ch.de \
    --to=linux@weissschuh.net \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=dgilbert@interlog.com \
    --cc=jdelvare@suse.com \
    --cc=linux-hwmon@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-usb@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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

all inboxes | Powered by JetHome®