[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <68d1490a-ba67-480b-943f-afa56e5b8436@kernel.org>
Date: Tue, 10 Dec 2024 15:38:38 +0100
From: Krzysztof Kozlowski <krzk@...nel.org>
To: Ming Yu <a0282524688@...il.com>, tmyu0@...oton.com, lee@...nel.org,
linus.walleij@...aro.org, brgl@...ev.pl, andi.shyti@...nel.org,
mkl@...gutronix.de, mailhol.vincent@...adoo.fr, andrew+netdev@...n.ch,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
pabeni@...hat.com, wim@...ux-watchdog.org, linux@...ck-us.net,
jdelvare@...e.com, alexandre.belloni@...tlin.com
Cc: linux-kernel@...r.kernel.org, linux-gpio@...r.kernel.org,
linux-i2c@...r.kernel.org, linux-can@...r.kernel.org,
netdev@...r.kernel.org, linux-watchdog@...r.kernel.org,
linux-hwmon@...r.kernel.org, linux-rtc@...r.kernel.org
Subject: Re: [PATCH v3 1/7] mfd: Add core driver for Nuvoton NCT6694
On 10/12/2024 11:45, Ming Yu wrote:
> + nct6694->int_buffer = devm_kcalloc(dev, NCT6694_MAX_PACKET_SZ,
> + sizeof(unsigned char), GFP_KERNEL);
> + if (!nct6694->int_buffer)
> + return -ENOMEM;
> +
> + nct6694->int_in_urb = usb_alloc_urb(0, GFP_KERNEL);
> + if (!nct6694->int_in_urb)
> + return -ENOMEM;
> +
> + nct6694->domain = irq_domain_add_simple(NULL, NCT6694_NR_IRQS, 0,
> + &nct6694_irq_domain_ops,
> + nct6694);
> + if (!nct6694->domain)
> + return -ENODEV;
> +
> + nct6694->udev = udev;
> + nct6694->timeout = NCT6694_URB_TIMEOUT; /* Wait until urb complete */
> + nct6694->cmd_header = cmd_header;
> + nct6694->response_header = response_header;
> +
> + mutex_init(&nct6694->access_lock);
> + mutex_init(&nct6694->irq_lock);
> +
> + usb_fill_int_urb(nct6694->int_in_urb, udev, pipe,
> + nct6694->int_buffer, maxp, usb_int_callback,
> + nct6694, int_endpoint->bInterval);
> + ret = usb_submit_urb(nct6694->int_in_urb, GFP_KERNEL);
> + if (ret)
> + goto err_urb;
> +
> + dev_set_drvdata(dev, nct6694);
> + usb_set_intfdata(iface, nct6694);
> +
> + ret = mfd_add_hotplug_devices(dev, nct6694_dev, ARRAY_SIZE(nct6694_dev));
> + if (ret)
> + goto err_mfd;
> +
> + dev_info(dev, "Probed device: (%04X:%04X)\n", id->idVendor, id->idProduct);
Drop. Duplicating existing messages and interfaces. Your driver is
supposed to be silent on success.
> + return 0;
> +
> +err_mfd:
> + usb_kill_urb(nct6694->int_in_urb);
> +err_urb:
> + usb_free_urb(nct6694->int_in_urb);
> + return dev_err_probe(dev, ret, "Probe failed\n");
No, this should go to individual call causing errors so this will be
informative. Above is not informative at all and kernel already reports
this, so drop.
> +}
> +
> +static void nct6694_usb_disconnect(struct usb_interface *iface)
> +{
> + struct usb_device *udev = interface_to_usbdev(iface);
> + struct nct6694 *nct6694 = usb_get_intfdata(iface);
Best regards,
Krzysztof
Powered by blists - more mailing lists