From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f46.google.com (mail-pj1-f46.google.com [209.85.216.46]) (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 B24C13859CB for ; Sat, 4 Jul 2026 05:57:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.46 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783144656; cv=none; b=AQx1RL+fqGJlzOfqpjQHuZzw2yS8Y95rfTcO0M9kFJBQx9ySXZ9I3mGQEnh5Ks9ltKsT4/n1ZMxmIkl4In0VZUu6mAVaoA0j3TG3QGv/yAr8nICEz3IdN2tsvAha35A2UnnjYBJV+FwE1oH3WpQ+GF6xeBzorkNuut3uVb72OSQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783144656; c=relaxed/simple; bh=Ix7/Y+EVEU+dwYPaF05H+bOo4qBH5GMr0TAV7TzgV/0=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=P+mvuV6074AH7BrZH1+a+uscoCBgt+gVveTEyzK0MkW9+a9owBMMyrarBD0hqcNGeUkfHxzf+dLYfBOY4veXSR7LDd0TtbTDlbhLIW1LGH2Zj8Th8kExsK5Ms+OIkHM5q4wvUgbLossRClcDYEC3eHouscpDH5hHeHlNIp3uOz8= 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=sirSMUFy; arc=none smtp.client-ip=209.85.216.46 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="sirSMUFy" Received: by mail-pj1-f46.google.com with SMTP id 98e67ed59e1d1-37fc02e660bso941931a91.0 for ; Fri, 03 Jul 2026 22:57:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783144653; x=1783749453; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=5+rvElI5DJc+LADkj/yI5i5ZTCILlIx+N3s68Xcqphs=; b=sirSMUFyc+mPqhNdNVT4usAvQ6eTAPsTEAYqeiUD7wzSPDPvw355bFs2iO7Sb01BA9 HLRBm6KHqqr9BfI6QXa2OjyTL04RVO1MFskDl1unSH00IyQwH6Jx9BSofL5BrhdYnayw vZzvJeuCkdE/w0VZpzt7eDGil1MsY5x5Kao668Tz2kBTrL6xKTSgl0K6o976PfFb8TFq TEBp9Jr6Gsu+s7wiIvedTIsJQNQgY6dwvlQq1wdx8Dd3OgrVnic6VLcyryXtRn6s/Qz5 XnoB+dpbzHqcAWDkViV4qsajYAorobYQUfSc5TPG7KiRHXIqw12j5a8RzNMER9wTqhOY m9lA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783144653; x=1783749453; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-gg:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=5+rvElI5DJc+LADkj/yI5i5ZTCILlIx+N3s68Xcqphs=; b=psL/w5smObIWGLxIFCq5hnMmc4rA8J2YK5Udot4hnmtz3tHKFbrD0U+qP1SJk9Rr4L U1+pPJ2+WPd8Gc/hnbMnbc1kCs1bg3aeA2aRI4NG2wFCLMt6sZ6wAaXft0M0Aqk7o3NI ochyjCpZVgtWSMldMnNEWmOH1cb16K+Ehn+FoOzUfuzkhSn66dmYI/j+TJFnplxS/uqk cc2Pj9jiqY6AbAVR0PE4Pxy4NByoWL5pYyyWzeAxprpcqfe56QohL/4Ca4Tx3cmaRxUb ZLokcdDf0blg7oUmPp+3rR6TKzXi4ogG8jbtO9zibwifuHxF9FLtDbAFVoAVV6tyhUU8 ExAw== X-Forwarded-Encrypted: i=1; AHgh+RobTTjHXdsjtIMN119aj1P7tXx0QnD1uUkJ2JIbd10VSF29rtVFPgOTb1BITvd4JDqb1E7qfBvjU5Ixv5E=@vger.kernel.org X-Gm-Message-State: AOJu0YzAGr2lWC2mlde8LMM8/op8OBu9RyxlhdzuCfLLoWAB8UZb1pBl bttPJTonFURiQgeA8dwIXmliCxd/maMTJrR6NUCGlcieC/PXWYxB2lZoTsDubw== X-Gm-Gg: AfdE7ckT/j3Ua5rmQtOoAoj4/z7449BjcaIFC/UGMynRBQayNzQYs8KBOcjBpKrKtXF /MER7ljQgOd/ZFi2h31KkTrOvzO0LfYJBCOYX6TJh+r02JqGdUy0r7ji6IVX4Dy5Fc/+CK0MJSe SCFYczRKbgt4vIMmITR7YEobD/cRvnh0pgYz64/EDm2LDSmEdZo1THEh7Fe4UHgdrYTjGv4lFwc cXTy24Y2UEWCPvYrFvGwhTsVKVyWWsjcs6iM/knJAwdmxzE7UX2IXuwsCpLemLfcHE91EMh4h9S u1soo/O+36FeHZBhH6F+hnJ9ms8OZKL//lf8dglMhkz+fmXUmpXMS7yXUKpLfj+pAAOPgLxTVCY Cei9rEtTF45Yp8D1Sz8nL5eYjRzSLfIZJnZFEFNBadi2jIkpuWkzidxF/scTgZlUEhdxpZIrBgV t8+fjGzh5+JmEU68tmSnMjpneHsxjJT0QJSmqgV+LRFqfIpmM/vsVwUohzmLLS02f8qU5EnBAr1 6Y= X-Received: by 2002:a17:90b:17c4:b0:380:40b:f30a with SMTP id 98e67ed59e1d1-38280d99e12mr2630038a91.13.1783144652797; Fri, 03 Jul 2026 22:57:32 -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.57.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 22:57:32 -0700 (PDT) From: Dmitry Torokhov Subject: [PATCH 00/26] sh: maple: cleanup and modernize input drivers Date: Fri, 03 Jul 2026 22:57:23 -0700 Message-Id: <20260703-b4-maple-cleanup-v1-0-41e424964da5@gmail.com> 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 X-B4-Tracking: v=1; b=H4sIAMSgSGoC/yXMQQrCMBBG4auUWTuQhhKGXqW4SOKvTmljSKwIp Xc36vJbvLdTRVFUGrudCl5a9ZEa+lNH8e7TDayXZrLGOuOscBh49XkBxwU+bZlFBifWozcSqGW 54Krv33I6/123MCM+vx86jg9nwHB4dAAAAA== X-Change-ID: 20260628-b4-maple-cleanup-884682ae108b 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 This series aims to modernize the Maple bus core and its input drivers (keyboard, mouse, joystick/controller), addressing build failures, race conditions, and coding style issues: - fixes a build failure in vmu-flash.c due to missing include - fixes keyboard press detection logic (eliminating a 1-poll delay and redundant press events) - corrects D-pad axis limits and optimizes event reporting using branchless calculations - implements open() and close() in maple_keyb so all Maple input drivers only poll when actively open - introduces callback_mutex in the Maple bus core to avoid potential UAF when stopping/unbinding the drivers - removes the unused driver field from struct maple_device (write-only since 2008) and eliminates the redundant maple_unsupported_device dummy driver - implements standard bus-level probe() and remove() methods for the Maple bus - converts all three Maple input drivers to use managed resources, and fixes style issues reported by checkpatch. This compiles but has not been tested on real hardware. Signed-off-by: Dmitry Torokhov --- Dmitry Torokhov (26): sh: maple: include linux/device.h in linux/maple.h Input: maple_keyb - fix key press detection Input: maplecontrol - only enable present axes Input: maplemouse - stop polling and clear callback on close Input: maplecontrol - stop polling and clear callback on close Input: maplecontrol - simplify maple_device retrieval in open/close Input: maple_keyb - implement open and close methods Input: maplemouse - remove redundant drvdata resetting Input: maple_keyb - remove redundant drvdata resetting Input: maplecontrol - remove redundant drvdata resetting Input: maplemouse - remove unused mdev->driver assignment Input: maplecontrol - remove unused mdev->driver assignment Input: maple_keyb - remove unused mdev->driver assignment mtd: maps: vmu-flash: remove unused mdev->driver assignment sh: maple: remove not needed maple_unsupported_device driver sh: maple: remove unused driver field from struct maple_device sh: maple: implement bus-level probe/remove sh: maple: introduce callback_mutex in maple_device Input: maple_keyb - remove redundant mutex and remove method Input: maple_keyb - convert to devm Input: maplemouse - convert to devm Input: maplecontrol - convert to devm Input: maple_keyb - fix style issues Input: maplemouse - fix style issues Input: maplecontrol - fix style issues Input: maple_keyb - remove redundant 'new' buffer from struct dc_kbd drivers/input/joystick/maplecontrol.c | 98 +++++++++------------------ drivers/input/keyboard/maple_keyb.c | 124 +++++++++++++--------------------- drivers/input/mouse/maplemouse.c | 55 ++++----------- drivers/mtd/maps/vmu-flash.c | 15 ++-- drivers/sh/maple/maple.c | 61 ++++++++++------- include/linux/maple.h | 8 ++- 6 files changed, 140 insertions(+), 221 deletions(-) --- base-commit: 2b763db0c2763d6bf73d7d3e69665222d1f377cf change-id: 20260628-b4-maple-cleanup-884682ae108b Thanks. -- Dmitry