From nobody Tue Sep 9 16:23:30 2025 Received: from smtp.smtpout.orange.fr (smtp-69.smtpout.orange.fr [80.12.242.69]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8573421CA0D; Sun, 7 Sep 2025 10:17:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.69 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757240247; cv=none; b=ifOcFlOm49wJ6Nz/O3ofFoukSvc8sl9d8KkrasE8seNc+qoCpyAzdecp3ksivK8yaySspjFNl6PW6s0YIN38nIv1UcJ9ZVoCLtMrFseTvUj0OSHKrYxLIqO7Eom1JyJCeuRCGffTxPZrPzcRemEV1IURyWOwZYB/9pHrWZmYmTI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1757240247; c=relaxed/simple; bh=VyLQINgFLxfwpG6Ab3GLfcDxtTMx9J9bYm0a0HSvfNo=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=BL5Q80vPjMdZWQJGcFIvXheqLCKbO3X/D7Jb5Vj1sUY/aQerOLoW3eDS7pvFRthg4uQ4mzmmnHZdXVwf5O3hBYYBfCkXQ5Tvg1ldg5q6etnRBDs04Y5QUINdMvOCIa9YOthwEsBElawT989/ZSmaiVdPS8FCnf9l12YA25O01gQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr; spf=pass smtp.mailfrom=wanadoo.fr; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b=rn8DKKPt; arc=none smtp.client-ip=80.12.242.69 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=wanadoo.fr Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=wanadoo.fr header.i=@wanadoo.fr header.b="rn8DKKPt" Received: from fedora.home ([IPv6:2a01:cb10:785:b00:8347:f260:7456:7662]) by smtp.orange.fr with ESMTPA id vCRRuFMYKVnEZvCRRuvdfD; Sun, 07 Sep 2025 12:16:13 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1757240173; bh=/8eo79CGIBKMU4I0nlE/+knG5URcycp+FdSO1C7XFNM=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=rn8DKKPtX/W8hBMbom+AY6GhwsLKdpzDO4pbxD8GPEUg7CCHvVq/vW28eidYIANYe EIG9Ow+3n60Q8xeyU+bS698FBWrW28Yilp0UuvTWTJlyzbHmhD7xli5zaibMwwRn6r AXjcQUgFWCGLRh6IsGx4LjbST9ko/pMt33ICNmjcoxBMx7GXNK8xonucqxxVm3LzRW znhtLGqRbAAgMzAfngd7bSXU6J0PDpL1hjNFE5tU/V6IekvGx+72kdhSAFH7qAyhfD 24eKgc9EdqcuMwKPbdGZ5tPGu13W7UfRDvj9sIKydcbuFVOWjeKYaqdzh7k//JTkOX DKiNIBD/3PKcg== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Sun, 07 Sep 2025 12:16:13 +0200 X-ME-IP: 2a01:cb10:785:b00:8347:f260:7456:7662 From: Christophe JAILLET To: Lee Jones , Pavel Machek Cc: linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET , linux-leds@vger.kernel.org Subject: [PATCH] leds: is31fl319x: Use devm_mutex_init() Date: Sun, 7 Sep 2025 12:16:09 +0200 Message-ID: <267aba6eab12be67c297fcd52fcf45a0856338bb.1757240150.git.christophe.jaillet@wanadoo.fr> X-Mailer: git-send-email 2.51.0 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" Use devm_mutex_init() instead of hand-writing it. This saves some LoC, improves readability and saves some space in the generated .o file. Before: =3D=3D=3D=3D=3D=3D text data bss dec hex filename 20011 6752 128 26891 690b drivers/leds/leds-is31fl319x.o After: =3D=3D=3D=3D=3D text data bss dec hex filename 19715 6680 128 26523 679b drivers/leds/leds-is31fl319x.o Signed-off-by: Christophe JAILLET --- drivers/leds/leds-is31fl319x.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/leds/leds-is31fl319x.c b/drivers/leds/leds-is31fl319x.c index 27bfab3da479..e411cee06dab 100644 --- a/drivers/leds/leds-is31fl319x.c +++ b/drivers/leds/leds-is31fl319x.c @@ -483,11 +483,6 @@ static inline int is31fl3196_db_to_gain(u32 dezibel) return dezibel / IS31FL3196_AUDIO_GAIN_DB_STEP; } =20 -static void is31f1319x_mutex_destroy(void *lock) -{ - mutex_destroy(lock); -} - static int is31fl319x_probe(struct i2c_client *client) { struct is31fl319x_chip *is31; @@ -503,8 +498,7 @@ static int is31fl319x_probe(struct i2c_client *client) if (!is31) return -ENOMEM; =20 - mutex_init(&is31->lock); - err =3D devm_add_action_or_reset(dev, is31f1319x_mutex_destroy, &is31->lo= ck); + err =3D devm_mutex_init(dev, &is31->lock); if (err) return err; =20 --=20 2.51.0