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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8055AC433EF for ; Tue, 21 Jun 2022 06:57:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346318AbiFUG5r (ORCPT ); Tue, 21 Jun 2022 02:57:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35316 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231830AbiFUG5p (ORCPT ); Tue, 21 Jun 2022 02:57:45 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7BF8B1CFE4; Mon, 20 Jun 2022 23:57:44 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 3D705B81699; Tue, 21 Jun 2022 06:57:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAE58C341C0; Tue, 21 Jun 2022 06:57:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655794661; bh=+kaDe/Oc1bAbXeDpkUaPaEqe5MkYjktUVSkOvw2ENsA=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=NL/Cr1TLFu3AZMGTVjKIQwKYHYVCEyrdjwzWY2iZTV9roW4HiOSgspUkaKbDUEg6i 0owWKTefExYoOqnTNKpDIsrmn6nz8Cglc/h1ag6r4+ubpDmjrIorxv0TNmb+Tyr6RM pf8rwjCz/wqwqCmHdEigjZkM9TDFLzOFPN889sJnXbtOEVy4aWwS/oM840gTr4CDOd 6O9j7Ry+ZbF1Xua5ybSoMEgzqy/uX90WUa2QQ9iSTsYLXTJ2KDEqjElm2aTY7VV4V1 rWoMFxXQ0AkyqO/6khHEeAKJ2yidCyp9GioqezwVzaZxbnA38TAs1koHgmoaUtIoKI IR9n2DSGh7ITA== Received: from johan by xi.lan with local (Exim 4.94.2) (envelope-from ) id 1o3XpO-0002OK-JE; Tue, 21 Jun 2022 08:57:35 +0200 Date: Tue, 21 Jun 2022 08:57:34 +0200 From: Johan Hovold To: Andy Shevchenko Cc: frank zago , Greg Kroah-Hartman , Linux Kernel Mailing List , Bartosz Golaszewski , Wolfram Sang , USB , Lee Jones , Linus Walleij , "open list:GPIO SUBSYSTEM" , linux-i2c Subject: Re: [PATCH v6 2/4] gpio: ch341: add GPIO MFD cell driver for the CH341 Message-ID: References: <20220616013747.126051-1-frank@zago.net> <20220616013747.126051-3-frank@zago.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jun 20, 2022 at 06:08:19PM +0200, Andy Shevchenko wrote: > On Mon, Jun 20, 2022 at 12:26 PM Johan Hovold wrote: > > On Wed, Jun 15, 2022 at 08:37:45PM -0500, frank zago wrote: > > ... > > > > + /* Create an URB for handling interrupt */ > > > + dev->irq_urb = usb_alloc_urb(0, GFP_KERNEL); > > > + if (!dev->irq_urb) > > > + return dev_err_probe(&pdev->dev, -ENOMEM, "Cannot allocate the int URB\n"); > > > > This isn't how dev_err_probe() is used. > > While I agree on the below comment, what does this imply? That you should only use dev_err_probe() to handle -EPROBE_DEFER. That's what it is was added for, documented as, and it is what the implementation still tells you. I see now that there has recently been some mission creep: 7065f92255bb ("driver core: Clarify that dev_err_probe() is OK even w/out -EPROBE_DEFER") I'm not sure I agree with that, but fortunately we don't need to have that debate in this case due to the below. > > And allocation failures are already logged so just return -ENOMEM here. Johan