Received: by 2002:a05:7208:3188:b0:7e:5202:c8b4 with SMTP id r8csp808840rbd; Fri, 23 Feb 2024 04:27:04 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCXT3Fydumj50QDhdQ2HvWy05BmdXbM9Vj8ksX90h6pn8msy7ItZ+/ilQ39hvycpyyIxASsfvcAwFnLzf5QgsjTi237IRQY5MBM/lVJsdg== X-Google-Smtp-Source: AGHT+IFj4QPv5wC4YtJVvBbEUEbNCOKvj0iSjgZclae0ouvk44djxsnyEL4E5AzuInlZxYOUnKqo X-Received: by 2002:a05:6a20:d48d:b0:1a0:5de4:2f53 with SMTP id im13-20020a056a20d48d00b001a05de42f53mr7718160pzb.25.1708691223978; Fri, 23 Feb 2024 04:27:03 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708691223; cv=pass; d=google.com; s=arc-20160816; b=Wqh0POjL8a0PJIN3sjRMfarjLER6pEMri8pNXvzztqi7Co1HEvvs2C0e+C8R/F/0Ud ovappYlutjfLPyqvAiGdc64EpA8kTSZ8IR9BxlxZLZJqTL+oZwthRQRX5KtzjUNuue3u k9ChYEag4p3qHSTxuF4hqC9EtZGtRe0+TGuFkhH30KOzJyvG4QKoofxE6ZjZJ1kueEDH 1ggk79ckLrnrc8PGywe2rZ6HC8NyvY8/hyN/xqgx1TolZD7Y75xTCrgzsmbOV/kfirCn 7K/Nv3xNZfvibUGmSPhnAUa5XAhXEhDdFXJ2B3RtjsZM+/A/zr0tPFb2l3cO71tIlrjH a1Xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=wCpS/jUTYLOZ0fDcQmJIwIBOst6krKf4KWBNveRLQuU=; fh=cE4kOQKF9g/FFJs6eFKgz8WIC6W8FPC2EDWHKLnyFSU=; b=UGJPgtVuNe6zwEt/E8n1sfSOIYi2sm1EXMRSpX+PRe7CFfZs2aNFBu7JwNeL4NJEZ3 oO82ZkvbyYwf8lXoRjAfeapXGfr0Hddj0kr3p7xpHyKWgyAwFkbQg+fIcZ7QnsKi6/20 NlQrxBF08xHoaAA+wl4HQ89C0SUNYCc5QCaRlIKnnuSYEaF5VQ3i0GAoroR1caVJ7VTB doEiMjQ7K/INvuD1p41UweAwLfcZ6Z94E+bRrVsLn2YuysUbK0tvxZQDKQfUBa6hrV4j 4/eJSbWtEhdlUlXypfwjpZRw1X2sfkK8VYp2QHW4rdjCZCUB+9x6ukJXzxXyHPOtNsUr 5FLA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="iZSQ/HTX"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-78291-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id bz22-20020a056a02061600b005dc8587419esi12358033pgb.421.2024.02.23.04.27.03 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 04:27:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78291-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="iZSQ/HTX"; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-78291-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78291-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id A7DBE28705A for ; Fri, 23 Feb 2024 12:27:03 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4577D7BB01; Fri, 23 Feb 2024 12:26:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="iZSQ/HTX" 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 5F7FE7AE78; Fri, 23 Feb 2024 12:26:53 +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=1708691213; cv=none; b=OdrTM2kuD2TxOriE+0KUooVEZoTh59RjIDk+IGLQcP9eIXzfyWuY4yUuXLEakiGuzUr+wTWzqAaGnCRiSV7TmfmsZFZukSIwLfq48DEJsdxlYPu0Og0AAMMh+NUW9uXoG5hHTC6G1/QzwNfERVlC7bhGQoWVD719r/brFM4edNQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708691213; c=relaxed/simple; bh=m//cWAePIv4cTZDYri/URPe8qx3PAjrr8Fa4bEJ/jYw=; h=Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=tDvMr1CYg2iRmhgQQJpJsM7baarWswrpTbR6W3u+K6Wacdi2TzHaVghlyC9Z1/HfeS9LHCAthrqIyHcLbUmaqe/SgimNuz5CkyF/7axPgoN7gJag7W6F9365gyE8+q9yvVxL/23TJ3WEYVjJgJt0jmkjNeO6NzRjjJxIlWTpWIM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=iZSQ/HTX; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7BB87C433C7; Fri, 23 Feb 2024 12:26:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1708691212; bh=m//cWAePIv4cTZDYri/URPe8qx3PAjrr8Fa4bEJ/jYw=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=iZSQ/HTX2hNdNLIy3vkQ2Mhcy7B3AcZ4GJzTIslwj7FQ9QGqb8MtlDta23N9Vwe3y lrts2nTwptGS/hOtaF7+eA6l3i8xvLLu6d2mb9F1zdiv+n1cHntDc/nedbnOWYAeuB 01Ncv/gZk50JdISyyt5DYanwA69wt70ASDNE7D21By/0wkVq8FBhYVnPDaioShYGTT ln5E16eNjwSVj0tLN6ftkdewOjFQZiPXKGfRPY3lmXnP/RZL27ltagxjwOgUiJUg0D SOg1MY5nYbXlOq/NQKd0Zr7V5psWedQv0i0fHhCIfcRvzKR9DryEmp+ZWCkAftnTkP jlPDUqkd21I/w== Date: Fri, 23 Feb 2024 13:26:41 +0100 From: Marek =?UTF-8?B?QmVow7pu?= To: andy.shevchenko@gmail.com, George Stark Cc: linux-kernel@vger.kernel.org, Hans de Goede , Matti Vaittinen , Linus Walleij , Bartosz Golaszewski , Lucas De Marchi , Oded Gabbay , Thomas =?UTF-8?B?SGVsbHN0csO2bQ==?= , Maarten Lankhorst , Maxime Ripard , Thomas Zimmermann , David Airlie , Daniel Vetter , Aleksandr Mezin , Jean Delvare , Guenter Roeck , Pavel Machek , Lee Jones , Sebastian Reichel , Matthias Brugger , AngeloGioacchino Del Regno , linux-gpio@vger.kernel.org, intel-xe@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-hwmon@vger.kernel.org, linux-leds@vger.kernel.org, linux-pm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-mediatek@lists.infradead.org Subject: Re: [PATCH 1/2] devm-helpers: Add resource managed version of mutex init Message-ID: <20240223132641.3e2ba16c@dellmb> In-Reply-To: References: <20240222145838.12916-1-kabel@kernel.org> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.39; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable On Thu, 22 Feb 2024 23:42:11 +0200 andy.shevchenko@gmail.com wrote: > Thu, Feb 22, 2024 at 03:58:37PM +0100, Marek Beh=C3=BAn kirjoitti: > > A few drivers are doing resource-managed mutex initialization by > > implementing ad-hoc one-liner mutex dropping functions and using them > > with devm_add_action_or_reset(). Help drivers avoid these repeated > > one-liners by adding managed version of mutex initialization. > >=20 > > Use the new function devm_mutex_init() in the following drivers: > > drivers/gpio/gpio-pisosr.c > > drivers/gpio/gpio-sim.c > > drivers/gpu/drm/xe/xe_hwmon.c > > drivers/hwmon/nzxt-smart2.c > > drivers/leds/leds-is31fl319x.c > > drivers/power/supply/mt6370-charger.c > > drivers/power/supply/rt9467-charger.c =20 >=20 > Pardon me, but why? >=20 > https://lore.kernel.org/linux-leds/20231214173614.2820929-1-gnstark@salut= edevices.com/ >=20 > Can you cooperate, folks, instead of doing something independently? Thanks Andy for pointing to George's patch series. I can drop the mutex_init() part and add just the debugfs part. Marek