From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8D60A38F252 for ; Sat, 4 Jul 2026 05:58:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.45 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783144687; cv=none; b=tMhf99q1iNVDD68pJYdSCE+UaVbPqaTmcJHpPsJwOso1gJPCd/Inlpjvh8uzkeaEMxMyBj1pwPGTJymRUPflGRm4Cf+h1Bh+bKDFJqBG+bkFdmjxWXA0WOF2O80qd7KCGroPyMd7Z4skf/Jh22tA7GCaVjbxyTi40oemhvSurJE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783144687; c=relaxed/simple; bh=gDXYl5f4DLrqbIOluEjUd2KJKz3Tf/PL0OeKByaERoI=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=KTiNVaMoVaNA4tYqxZntCbimsY1bgtRHkZw8TEtgkk7h/oe/7uG/xZ62080V6h213W49VxV2mOnEIuKEqkdscUJxAytB+ABRiuwPuPeT8r6kfrnplHpet48Zc5UiZ+9EJh3tf7+tVxJjldYksvwk/puABS9udorSj6kj82QoQzk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=PqXC6fKF; arc=none smtp.client-ip=209.85.216.45 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PqXC6fKF" Received: by mail-pj1-f45.google.com with SMTP id 98e67ed59e1d1-36b9d265355so910641a91.2 for ; Fri, 03 Jul 2026 22:58:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783144685; x=1783749485; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:from:to:cc:subject:date :message-id:reply-to:content-type; bh=aIbYkeRmMJ3qAal/r9Tkhbn+MH1/NZUDryRDlJi/XtY=; b=PqXC6fKFakTuhwM7eV2JU/C+8765z0SBijpCyigMocPunpk3SpSZyXxYaTHus6UlZ/ W5przou+Im4xs+A8KJr7+taixhRzDZCwx0cJtQZMeVF/iu4pw/QlfN+iPsYMB/3DW9y4 DPqvxj5MHR/xgg7pA9q7/SP87zZonbeaMR6lVyM/IVe4HxSfV1r0vlGGIJWX8W5fsSGr qwc69SAzbU+g4AYdS0epZFKga0lhitcrGnTd4q+1QIDImU01USFGq7VFCeIFKbFpRlmZ CWM1ZGw04dhtibQXdxsDoi5l+VJlt4yq5BXDXEUTp0oZ8tVn7VeFY2K9a1RpRibJoTro ujkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783144685; x=1783749485; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :content-type:mime-version:subject:date:from:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=aIbYkeRmMJ3qAal/r9Tkhbn+MH1/NZUDryRDlJi/XtY=; b=dG8TZF0loFbVHpIl52e0H+vmmMZJy9iY5Ljwb4vgJRUkwiQqF0kBw36x5SJdpR5VMR e7KJz5iqP+iiJcfjy5JPEG+Yn4zErRk1UcDPPLhsetudkcse3GR1/gBztuKywbi0OWeb QkNYO/JnEJBBVkjJrcUOPfuduPt/w2J73aOFvP9eWAq7Ef5IgMdpZ6+3EuBzCCZH7gXS MGqzvWbafuzLCH2K1fM4Ymd3oHqIT1k7uPvW92kCoMHU8rPPpe+WeDKaHWgERCxICgl9 RLWCI1n2Rnc5bNHwzt4Gu2XXf0fH0RokOh2cp6QRKtSGG4dr3eqyZGVp2iL9Ns9bjqUK OtRA== X-Forwarded-Encrypted: i=1; AHgh+RqMaF7TnQWuMdxbPYYisaAP4KrO9gLTHxHiHZz4SknvFxFxymvJDQP6gZVhZa0k8PFvL26xA+pmBb/xvh0=@vger.kernel.org X-Gm-Message-State: AOJu0YyxtB3DGvMkKAMhfDe6DIzgC7OA9o9aTJXMizaETpTxKe9hlsbr MiFHaPUAAEJ5qzBpY2GXEpO+M821fo3AP7z3RM5eTO7OVJmeE1Jdzu9xdeIjjA== X-Gm-Gg: AfdE7cm350b+cnuCt07FWi89hNxdQHQa3mdGvGLc81euHadHIdxeiDurQjjR95267uB Q0XS+SY+aOAoyRdpeh44NIn37fv0T6bvBmxM9fFakzkd7EB5aGKx/jr7DsY10fxRxBg/i1QjNoY zyh8QUQaBOYowfMRiY/0WCwW0ZGElHuw2HQ9kvsCEFozmNQ0t4z75kurM6EmematcnUkIjjzZUB hNNxlZHnEFuIBWxcUKnJv3P4fEu+f6nkZRyosEfU8q9jMW/Us8cMEB2Mt6AhBh1QQOkx1ZowuHb /cb0LaMcY3k7RWKPhiFrW3rgfDrvZfwlM9APSWYGJ2uW7pnp00fI69xqlbyToE7v6ra9kfZWMP9 6kXCrDqZPKQkMx5ELTbpqjTFtoB3RJV3YjTDHr3MWN0aUpmH5fv2DdMNDT4WwpBiJzIFoRnMykX BC9pCEXJdTPh7cgV8lo82W4OEk4wO9Gc4RqWmb4CgP4R9BDnwTUKygKDSgHSwgI7RUR7wt0a79l Sc= X-Received: by 2002:a17:90b:564d:b0:381:889a:65ca with SMTP id 98e67ed59e1d1-3829f5e7806mr2141892a91.28.1783144684570; Fri, 03 Jul 2026 22:58:04 -0700 (PDT) Received: from dtor-ws.sjc.corp.google.com ([2a00:79e0:2ebe:8:880:86f9:3b00:6746]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30f0b813cd9sm26262412eec.8.2026.07.03.22.58.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 22:58:03 -0700 (PDT) From: Dmitry Torokhov Date: Fri, 03 Jul 2026 22:57:42 -0700 Subject: [PATCH 19/26] Input: maple_keyb - remove redundant mutex and remove method 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: 7bit Message-Id: <20260703-b4-maple-cleanup-v1-19-41e424964da5@gmail.com> References: <20260703-b4-maple-cleanup-v1-0-41e424964da5@gmail.com> In-Reply-To: <20260703-b4-maple-cleanup-v1-0-41e424964da5@gmail.com> To: Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Yoshinori Sato , Rich Felker , John Paul Adrian Glaubitz Cc: Florian Fuchs , Adrian McMenamin , linux-kernel@vger.kernel.org, Dmitry Torokhov , linux-input@vger.kernel.org, linux-mtd@lists.infradead.org, linux-sh@vger.kernel.org X-Mailer: b4 0.16-dev-6911d Now that the Maple bus core handles callback synchronization via callback_mutex, the keyboard-driver-specific maple_keyb_mutex is redundant. Remove the mutex and its usage. Since the mutex was the only reason we kept the remove method (to synchronize during detach), we can now remove remove_maple_kbd entirely. The devm-managed resource cleanup is sufficient. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/maple_keyb.c | 25 +++---------------------- 1 file changed, 3 insertions(+), 22 deletions(-) diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index ab9257db7e03..aa9a4a80e26f 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -14,9 +14,6 @@ #include #include -/* Very simple mutex to ensure proper cleanup */ -static DEFINE_MUTEX(maple_keyb_mutex); - #define NR_SCANCODES 256 MODULE_AUTHOR("Adrian McMenamin recvbuf->buf); - /* - * We should always get the lock because the only - * time it may be locked is if the driver is in the cleanup phase. - */ - scoped_guard(mutex_try, &maple_keyb_mutex) { - if (buf[1] == mapledev->function) { - memcpy(kbd->new, buf + 2, 8); - dc_scan_kbd(kbd); - } + if (buf[1] == mapledev->function) { + memcpy(kbd->new, buf + 2, 8); + dc_scan_kbd(kbd); } } @@ -211,22 +202,12 @@ static int probe_maple_kbd(struct maple_device *mdev) return error; } -static void remove_maple_kbd(struct maple_device *mdev) -{ - struct dc_kbd *kbd = maple_get_drvdata(mdev); - guard(mutex)(&maple_keyb_mutex); - input_unregister_device(kbd->dev); - kfree(kbd); - - -} static struct maple_driver dc_kbd_driver = { .function = MAPLE_FUNC_KEYBOARD, .probe = probe_maple_kbd, - .remove = remove_maple_kbd, .drv = { .name = "Dreamcast_keyboard", }, -- 2.55.0.rc0.799.gd6f94ed593-goog