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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 2D219C02198 for ; Tue, 18 Feb 2025 08:18:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=t/lrDedJJ1idVYsVPEk1goi96+jJdB8xr7WcM2rR7ZY=; b=EjLNO44XSfVbnF oBoC3kb76XXiOlfgs5vxbJV0iVG8mLj0JzTVhzZcTR/7CtyQ8X+ppOG9GAN7hPiuIb4VRpkEvpwZx sjjl77q/dz/Zo4lm6tDCN/oKryONUqAFcyQgrRInsqP8yr2yPqGMOhl/NVKeSj05jXoVuE+M3/bJ3 byjSwTxfJSMlxaXtO3KOCUXGEZJ0/aQWaddi2MpmhxFpShdOHfbrHiVK0v/sVtkhacySLmnzKumTP z23asnMNLwla0fx4GuW7okVyQUzidcQw1P7/O9Sclmrtd9cqQo0CwagXQQ740gqnzmWWFDXjFhKHi nhOSTwRFg1AO6g6r16cA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tkInr-00000007E9d-43UW; Tue, 18 Feb 2025 08:18:03 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tkIkx-00000007DDD-3T4l; Tue, 18 Feb 2025 08:15:05 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id D61D65C5BA3; Tue, 18 Feb 2025 08:14:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 303D0C4CEE2; Tue, 18 Feb 2025 08:15:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1739866502; bh=UFdR7IbguGl7iKpceVwoQo+fFJc+Ocd7Dgzg0nOOeAE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=f4mC4+xjy8+3Ap3+zmCq4f4juZVPx3MmLXCA2pN+OuMHab5gaVtMq0RgIb/vmcIt4 5pomyFm6UrsvIjuGwEbtdC0Cnn6HgTkNdbLBGtu/S6H3634IT4Qh8f1TMWeYpsxTMx HEiie4JkezV19OJAsaovd47Bq7gU0JDqjGhlceHw= Date: Tue, 18 Feb 2025 09:14:59 +0100 From: Greg Kroah-Hartman To: Jerome Brunet Cc: Dave Ertman , Ira Weiny , "Rafael J. Wysocki" , Stephen Boyd , Arnd Bergmann , Danilo Krummrich , Conor Dooley , Daire McNamara , Philipp Zabel , Douglas Anderson , Andrzej Hajda , Neil Armstrong , Robert Foss , Laurent Pinchart , Jonas Karlman , Jernej Skrabec , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Simona Vetter , Hans de Goede , Ilpo =?iso-8859-1?Q?J=E4rvinen?= , Bryan O'Donoghue , Vladimir Kondratiev , Gregory CLEMENT , =?iso-8859-1?Q?Th=E9o?= Lebrun , Michael Turquette , Abel Vesa , Peng Fan , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , Kevin Hilman , Martin Blumenstingl , linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org, dri-devel@lists.freedesktop.org, platform-driver-x86@vger.kernel.org, linux-mips@vger.kernel.org, linux-clk@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-amlogic@lists.infradead.org Subject: Re: [PATCH v3 1/7] driver core: auxiliary bus: add device creation helpers Message-ID: <2025021826-smile-batting-e52f@gregkh> References: <20250211-aux-device-create-helper-v3-0-7edb50524909@baylibre.com> <20250211-aux-device-create-helper-v3-1-7edb50524909@baylibre.com> <2025021437-washout-stonewall-d13e@gregkh> <1jwmdsxugx.fsf@starbuckisacylon.baylibre.com> <2025021501-tamer-sank-142a@gregkh> <1jikp8xx01.fsf@starbuckisacylon.baylibre.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1jikp8xx01.fsf@starbuckisacylon.baylibre.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250218_001503_952710_67033CA6 X-CRM114-Status: GOOD ( 14.38 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+linux-riscv=archiver.kernel.org@lists.infradead.org On Mon, Feb 17, 2025 at 07:10:54PM +0100, Jerome Brunet wrote: > On Sat 15 Feb 2025 at 07:53, Greg Kroah-Hartman wrote: > > [...] > > >> > >> > > >> >> + int id) > >> >> +{ > >> >> + struct auxiliary_device *auxdev; > >> >> + int ret; > >> >> + > >> >> + auxdev = kzalloc(sizeof(*auxdev), GFP_KERNEL); > >> >> + if (!auxdev) > >> >> + return ERR_PTR(-ENOMEM); > >> > > >> > Ick, who cares what the error value really is? Why not just do NULL or > >> > a valid pointer? That makes the caller much simpler to handle, right? > >> > > >> > >> Sure why not > > I have tried the 'NULL or valid' approach. In the consumers, > which mostly return an integer from their various init function, I got > this weird to come up with one from NULL. EINVAL, ENOMEM, etc ... can't > really pick one. > > It is actually easier to pass something along. Ok, fair enough, thanks for trying. But I would have returned just -ENODEV in all cases, as that's what the end result was :) thanks, greg k-h _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv