From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A4C413EBF08; Mon, 23 Feb 2026 10:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771842975; cv=none; b=P783hxqS5GPMFAoDlUoQw61bXDz2g0/BZNao60qvdJTQIVH5W82mlLXp3afo1ctCBJvQWbIcpJwk4W/oq2nMN7luRdghwK0Rm+tciRR7Zmfp4BsTPyMn1JGKn5X0C9/FUSw7M4061DcvyaIM1AQR/mOSBVj2AQ8OuRXVP5z6Jbk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771842975; c=relaxed/simple; bh=AiVxbYjTjkFCDusZ5tWu7n3s2U71UIpWbTezPnBHohQ=; h=Mime-Version:Content-Type:Date:Message-Id:Subject:Cc:To:From: References:In-Reply-To; b=fwbZGARCuVr8IQ5jCrO5IZLSYgYdDlr5+FTlevUNNwbb2fxQNeUynsrq0LStNnbVL/Ukf5MnwBhp47X1gGXXM2VvSBPmERZmhQr/49HGlwmwXkB3ZMuuvXrh/el1HahphP4OPXpaD1ZQpcnLXUg6HvlJwUYBJNAqFa5U5Cz9nVk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=g018biIb; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="g018biIb" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 50DB8C116C6; Mon, 23 Feb 2026 10:36:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1771842975; bh=AiVxbYjTjkFCDusZ5tWu7n3s2U71UIpWbTezPnBHohQ=; h=Date:Subject:Cc:To:From:References:In-Reply-To:From; b=g018biIbLMWiMgHMZWobv71WB0aDNk0V5mHABji3/oQj3XLzM55HPmrBH+gw8NLP9 4aFelAoKv77LNIwGM+/LTapuKx9mVvzEJ2L301pPtTMtOM0r8aXiVRj5h0tlOYPnq0 brl1ukA+PDKddKhXcBHoVMuJcO/8RzmbIldDMOOJjgUT92rUnefSZbuOXkTIRjUX9P joksQ/AF6fENHVP37XJW5oZWiAzNSPklNWkkCfGuG5kfnx5WJyX+qqe/Cp7gpQNvkT FOUUUbuXuikeaIw63y50ihIesqm1gE1hUP9Cy1hgtbOVFCRNlNdZfvKbHVgxwQe8ft zfydjoMRh3uMQ== Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Mon, 23 Feb 2026 11:36:08 +0100 Message-Id: Subject: Re: [PATCH 1/9] workqueue: devres: Add device-managed allocate workqueue Cc: "Greg Kroah-Hartman" , "Rafael J. Wysocki" , "Jonathan Corbet" , "Shuah Khan" , "Tejun Heo" , "Lai Jiangshan" , "Tobias Schrammm" , "Sebastian Reichel" , "Andy Shevchenko" , "Dan Carpenter" , "Krzysztof Kozlowski" , "Lee Jones" , "Dzmitry Sankouski" , "Matthias Brugger" , "AngeloGioacchino Del Regno" , "Benson Leung" , "Tzung-Bi Shih" , , , , "Sebastian Reichel" , , , , To: "Krzysztof Kozlowski" From: "Danilo Krummrich" References: <20260223-workqueue-devm-v1-0-10b3a6087586@oss.qualcomm.com> <20260223-workqueue-devm-v1-1-10b3a6087586@oss.qualcomm.com> In-Reply-To: <20260223-workqueue-devm-v1-1-10b3a6087586@oss.qualcomm.com> On Mon Feb 23, 2026 at 8:27 AM CET, Krzysztof Kozlowski wrote: > +__printf(2, 5) struct workqueue_struct * > +devm_alloc_workqueue(struct device *dev, const char *fmt, unsigned int f= lags, > + int max_active, ...) > +{ > + struct workqueue_struct **ptr, *wq; > + va_list args; > + > + ptr =3D devres_alloc(devm_destroy_workqueue, sizeof(*ptr), GFP_KERNEL); The function pointer passed to devres_alloc() is commonly named *_release()= . > + if (!ptr) > + return NULL; > + > + va_start(args, max_active); > + wq =3D alloc_workqueue(fmt, flags, max_active, args); > + va_end(args); > + if (wq) { > + *ptr =3D wq; > + devres_add(dev, ptr); > + } else { > + devres_free(ptr); > + } > + > + return wq; > +} > +EXPORT_SYMBOL_GPL(devm_alloc_workqueue); > +void devm_destroy_workqueue(struct device *dev, void *res) > +{ > + destroy_workqueue(*(struct workqueue_struct **)res); > +} > +EXPORT_SYMBOL_GPL(devm_destroy_workqueue); I assume you did not mean to export the release callback (which doesn't see= m to be useful), but a function that calls devres_destroy(), i.e. something anal= ogous to devm_remove_action(). If you don't actually need it, I would prefer not to add something that cal= ls devres_destroy() for now.