From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pg1-f173.google.com (mail-pg1-f173.google.com [209.85.215.173]) (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 EB45D38BF81 for ; Sat, 4 Jul 2026 05:57:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.215.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783144667; cv=none; b=rnPx7G2X1bZ1y1EctC5cUpF0d//cEkTG+o5uHrBRMlgLlK0pdWldEitnMvllCVzGXE+lmBSaWsXlFXt2maufybMfgsuGUkaAsRG4m08KeVMNtpN1XaJ23eN0WNYj5d1EbWN/Gkb/f4kB2Ql512EUQ7pe5sV3S7lMLzWQF9jZmRo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783144667; c=relaxed/simple; bh=UZSM3eWv9Q5ewCC7Mf4OpTsyzSqpcOfv7jMvg20ynLg=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=gtd5SvfJMTadwZpnAWvmfNhrF8mycr6f/xY8hhmKC1i69veBD2Oi/ivlljd6SuBCrZjHhuRZT5tjBlvgXatNw2yZOTq86R/IOoGZPnc5tZa85MejucFZthUraqnsuqTalQSb02IPCOZHm1PLzoZ6hNqBLmP6yNeMF6bijkkPlWs= 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=EBQ660tP; arc=none smtp.client-ip=209.85.215.173 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="EBQ660tP" Received: by mail-pg1-f173.google.com with SMTP id 41be03b00d2f7-c99eaa1f020so1268815a12.2 for ; Fri, 03 Jul 2026 22:57:43 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783144661; x=1783749461; darn=vger.kernel.org; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:from:to:cc:subject:date:message-id :reply-to; bh=15hSQeEEYahDoHIjuKW6WN5DINg66LHxIgPA/aX6Wqk=; b=EBQ660tPO+qC77gimM2m6DI0qfLh0hXUUlNlAye+sAF6tbl2tTK22GlPT+Lk/VVZhx iLoTCplTHhttB1eDSn48C0nFpud98oIhFypd/bACqAhgyXaS2hqUvzmRyrf7i2iRvN2Z qExcMzx0H6FX+P2pon5LD90i7BS1277002N3udbKYpIVpvoJlbgVJUbyr7aEnnezW8rG tGijeP19gXhqkFmj3X8Z2B/WxAGJL6a9JnoozPWrjJ3IuzG+P3gxizO8AQh+KdNbihrI Cw2+XMVENZK3ij8lJzODRK9ytfZUuWYKi1M/qxiHu7ngfYlnGgO4JB1b0H3GaBF3NlRv 4QvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783144661; x=1783749461; h=cc:to:in-reply-to:references:message-id:content-transfer-encoding :mime-version:subject:date:from:x-gm-gg:x-gm-message-state:from:to :cc:subject:date:message-id:reply-to; bh=15hSQeEEYahDoHIjuKW6WN5DINg66LHxIgPA/aX6Wqk=; b=h8eW5m2ddWvpvnA+IKqY6smdoZ1nI8gFI1Jy4+Ak4++B+VUJuKiHUYLKgeesIDlPWr iMNOfv1bLk76Z/gc3SAZYaBBglYoQ0G3u5XXAySk+dU4mGShi3TZOIruWt2qinKQmwJL JycK5Qb88YHImRvgPiPWNk4IWwqnu2FvUokwU0OKtrs7QCEgU/hJtnuXQ5z94GJVeGBM NDID2KlDZn0AR+/X5dYDE0SvBBl22uXud9N61RMeuR2VSUH2QWVR548DgL0gFYq379mZ 75ebrnYZlQ61bz4Njhn0acOeshO3XCxf2d+qOf/OW1w8c8SO1XbEVMwxUXcs4LJaPX+S XRMg== X-Forwarded-Encrypted: i=1; AFNElJ+TkO3mByehdIMMwdQyVz5wVHSiKBn+6dFR/GvSWM1dzCugyaF5xsi/cxaB//lQTdaBXYE7k9uSMI1RnoQ=@vger.kernel.org X-Gm-Message-State: AOJu0YxXx3OOYtWXMfU9nw7BD6Ss9Hb8SzjVKe3lESpDJLyGoN96LxiV fbLH6dOb2Q4QadNBqZR8IoluWL2L/nKiSuyCCmSEYFOX5kpC9eot6cSaHv8DYw== X-Gm-Gg: AfdE7cneas47/OhbvRFeabBF0UkFhnS6MNJWLqUH/PH1hoSzC9R/Jzp3dRcVT92YDzD 4H+BAPYODicvdZcMhL5gKGEbsCYjyKKEX8b6OH8kPGNk4HnoMbmctu/DIl554VDThAlFjS7nxtq 4mt1Xs5gHG8YKe7ZEkJGgv6HvQhC4thqg4UsuADNwC+P1l5l+68Uq2QSf9k/cgj0VbddPnL+F9v S5h/Fk3ms1yJGyVQJl0QpK/WhviT3EAfRR8cpTDTnREIi+6dhCzc4YqwXLYVJchYzgWnpmj31ee /U0dNJfIAE/e7+2SarHs/ubhbPWMvQ+f73uvY39okvLIDhfCfzHNJV7BOJ3PSWQ4SIRI3HPth9z AOAKlrwhlB+U/BW+cczy4ymjRjZTz4k1cegL2lNbG8cS6kgHivbfBtTCGrQxJrs0wUiuaN1mg2w 1mX8DbtK5H7wsnqhm47+xuz6lxeN6odxUXGgJtB5z2tYFPE1YlyZ8WmkaoPhMj6Ywj5y08rLFfV qg= X-Received: by 2002:a05:6a21:44c8:b0:3bf:6c08:2849 with SMTP id adf61e73a8af0-3c03e540d9dmr2322074637.56.1783144661119; Fri, 03 Jul 2026 22:57:41 -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.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 22:57:40 -0700 (PDT) From: Dmitry Torokhov Date: Fri, 03 Jul 2026 22:57:28 -0700 Subject: [PATCH 05/26] Input: maplecontrol - stop polling and clear callback on close 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-5-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 In dc_pad_close(), pass NULL instead of dc_pad_callback to maple_getcond_callback() to both stop polling and clear the callback pointer when the input device is closed. This makes the manual clearing of mdev->callback in remove_maple_controller() redundant, as input_unregister_device() automatically closes the device if it was open. Remove the redundant assignment. Assisted-by: Antigravity:gemini-3.5-flash Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/maplecontrol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index a498fc322c4d..c66b2614e298 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -74,8 +74,7 @@ static void dc_pad_close(struct input_dev *dev) { struct dc_pad *pad = dev_get_platdata(&dev->dev); - maple_getcond_callback(pad->mdev, dc_pad_callback, 0, - MAPLE_FUNC_CONTROLLER); + maple_getcond_callback(pad->mdev, NULL, 0, MAPLE_FUNC_CONTROLLER); } /* allow the controller to be used */ @@ -156,7 +155,6 @@ static int remove_maple_controller(struct device *dev) struct maple_device *mdev = to_maple_dev(dev); struct dc_pad *pad = maple_get_drvdata(mdev); - mdev->callback = NULL; input_unregister_device(pad->dev); maple_set_drvdata(mdev, NULL); kfree(pad); -- 2.55.0.rc0.799.gd6f94ed593-goog