From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) (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 4814A38A706 for ; Sat, 4 Jul 2026 05:57:42 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.53 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783144663; cv=none; b=J80eg0wk6WQ7ZmuMNor9shTCe0ei9Dc/qrgbkfIhc9rPASiyHa6+2DZx68hwQ0GqqnUbwcf6+K3N8hhpwhzjJmYM7UmqLOOE7p49cMzQIdPWrY3BhLIl5IeUBnuJU6RRji8bixATASPN8YrmIDOeKGW81W3ugt4IsIoXyjJnvc0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783144663; c=relaxed/simple; bh=DdlG5IdkoCXBQ907RBiN6XiEFgItuIUy9eJMTMGaJEc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=k9E0mztUshwVx1xkqPBihezm3oE/BdQGGO5+/TKJLzeRE+JMv7umu1rgu9Oi5fcI+qmgiQAYtRvthk3QIdOUz/s30n9/QfYH4buM04aZ8YTOIwIRQl47cmGRGXPCYYLp30wtiqy7vRG6YPrjvhM0h3aGNFhuaVevyFDoh0rdhLw= 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=e2fEraH3; arc=none smtp.client-ip=209.85.216.53 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="e2fEraH3" Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-37d55e8d3e3so854699a91.0 for ; Fri, 03 Jul 2026 22:57:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1783144659; x=1783749459; 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=ZpRM5xO2P6CrGv5fZ5v8OZOm8BQmO2xLbX7VVDuxobU=; b=e2fEraH3wg1AbdS1O2L9iUT6PRowvs9aZUOZZjeJg0pd+nRm3owQDX0+ko6XioW8y3 jnSRzFRNpp6rwWgAV5TH3/qfEiiWf9MBw0CHxdWvFbeRJcbevgdM1JDHCTzGnQK+MjId Ya8LxFSD/E7knlZzh9lTSC+oot/Axm1c9i0l/dOV0VkdRhEvN+TVxg90VaN1zmaSq71J xMBbNvZgKw/ZQmbOlYK40cFJihnpcZB452X6hqAGqs3D9kV3J0n1SElvr8WT8FNQmuQl n/2SyAYFWeR5SUA30GmzjRvGlz8JBU2k1RxYwz+oeDSePFg4isf66ahJAFtHCDYih/gf KzPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1783144659; x=1783749459; 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=ZpRM5xO2P6CrGv5fZ5v8OZOm8BQmO2xLbX7VVDuxobU=; b=aooSKCrRuq+uZZXbx8L7YuqB4JMtTdsbmshqufaOegbVQHaPRqv8F8SWYxa/F6r5cs phX6qyZCFNzHmZw+Xb9CWaHvp1dYCxn5Tpg9jYR5CZJN2Sue4ERM4lQ8pIm63zk/zJk7 AwSYCh//j2DSCsDS38DZtr1sINm0cX0RlPhxZmhq0vPLwS/Ly24D96q9xefivemLpsEB 2y0qXwOdp7cF0lIBOtKnMmtcufdiSO/0l+sbBsQHGcCs3C3aEeerF2/9t5k5gzhMQDr7 cqe+S0t+JLv11g+6ZkcJ4F0J3jdsSiCRs8F4Ru4YU93/gm1c6mfjynkJXEFo3Oe3rqH1 XU/w== X-Forwarded-Encrypted: i=1; AHgh+Rpi+EJP33flBRqVuJMfYJv9f9/it2L1aclTYPbjeUra5PVObtbfAFkpSsz+K6aUzLRL9kDnO5/e9cw8uPQ=@vger.kernel.org X-Gm-Message-State: AOJu0Yx1K1vFRLjxgmZYRRW4rxAR/UgvwsXlMI/zWw+xlT0aM2067qiy Qnbfki7BC4p0wvABlT6ReSpTkP+NBp1/woJQ2WWBdR+falQORESf8Qs2KI63AA== X-Gm-Gg: AfdE7cks4PrzAViYjA1V961eCRFMn25jyVh6/skWkdWlAl+FlWZdPflMnwx12ztNc+a bCu4OvMfma9d9CDNbe2lbRj0SwdPbwYg5bhxRrvgZSDF0akM1t39OJt41YMety1e0phzorLsC9b ZmeB/Zv2h2OlyHdi7AOh0cjW988ni/yu5uzwVwx/qR8ML3DSZqYGhwPb8gtIjvtyxORYG22qY5l Btl/5XVzVvy/97/IBHWqBKEX7bKlgf7oeG1P6eV4sXcEUQnWDsrTVxzeIRQLIeUnmp4+eNTgwvV S2T4qJ4rjWhmgYxY/vS0ZXMGC3tiThbXzjZWfFPXklNvUSUsBxFnoV3QEWAZUVgsOnAQCb9YHkZ Ktts3fXUyyyDFiVzhFAhUEzH2JR1zkpHv4AotZd9ApD+siSigF20W/ifZUw+InCWzvSEQ1qWeOf lfKBT8w2Ls144yvnmj05oHJTz1qrFau85uw3Bmg3VYb/83/0Ocvq4+WtM64gTm6lsnXvF8uepsW WA= X-Received: by 2002:a17:90b:5251:b0:380:8bb9:aba9 with SMTP id 98e67ed59e1d1-38112063c22mr7851183a91.3.1783144659437; Fri, 03 Jul 2026 22:57:39 -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.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jul 2026 22:57:38 -0700 (PDT) From: Dmitry Torokhov Date: Fri, 03 Jul 2026 22:57:27 -0700 Subject: [PATCH 04/26] Input: maplemouse - 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-4-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_mouse_close(), pass NULL instead of dc_mouse_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_mouse() 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/mouse/maplemouse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index 0c8f7d1b02aa..97d520e7d66d 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -60,8 +60,7 @@ static void dc_mouse_close(struct input_dev *dev) { struct dc_mouse *mse = input_get_drvdata(dev); - maple_getcond_callback(mse->mdev, dc_mouse_callback, 0, - MAPLE_FUNC_MOUSE); + maple_getcond_callback(mse->mdev, NULL, 0, MAPLE_FUNC_MOUSE); } /* allow the mouse to be used */ @@ -122,7 +121,6 @@ static int remove_maple_mouse(struct device *dev) struct maple_device *mdev = to_maple_dev(dev); struct dc_mouse *mse = maple_get_drvdata(mdev); - mdev->callback = NULL; input_unregister_device(mse->dev); maple_set_drvdata(mdev, NULL); kfree(mse); -- 2.55.0.rc0.799.gd6f94ed593-goog