From patchwork Thu Jul 25 20:46:49 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13742153 Received: from smtp.smtpout.orange.fr (smtp-22.smtpout.orange.fr [80.12.242.22]) (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 64880143738 for ; Thu, 25 Jul 2024 20:48:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.22 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721940495; cv=none; b=M1aI5r+mjn+TTE1Je8zSrB2WAFZN95D2CKAJzEXoulrruAEWcUd2QEBsOnhVhjxW8Iy4fnsgSOBNL11K/rKd6sVafbHW8TT202Lwr4x+XZ4zIru+KLE2RUyAEOVq9/nlUXh9RutDVFa0ymR4z1t94kEzm+VgdzB1gXgUh4jen7I= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721940495; c=relaxed/simple; bh=zIezW2gyvZlphHWc2qpY5uwJDFehBqLxbokz8cFiNY0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=W4JMTW1bg+z7mPRsSGe8eg8m/ZTg84MDL6ENjRatyWhh6KWR5VfASbOmZ9HXT7aakZcZp5nLQi89N1TfmgRLvi+hIpwbX8ri01UY7aI9ojladyfJ7G52YKTLAfy4XYPW9+9zY2NA9+68zXy+hXyBzxHct6pArBgUVpbdF+f5l6s= 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=bLe4FTQQ; arc=none smtp.client-ip=80.12.242.22 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="bLe4FTQQ" Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id X5MSsJCR06bu3X5MYs692a; Thu, 25 Jul 2024 22:46:58 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1721940418; bh=rozVsuc8wM35stzKu05d3CpPokbEuodbf3R8I1BIa8Q=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=bLe4FTQQ3g1+g+UM+vKQg2QlJcC5pTyw3gt+HfOSqPlsusCQKeCTyoLVq+BtDyx1h ll/mfS6DvWLUdV5c9+ez3XhxfedTY10dJCOUn5/uamnboax9fyAXwhdg+PNWZVAe+U MkXbAOMVq53IlwMFWu0RgSNnn8FMW0ovfElcyi4hOWQrW5ZgHPpeoc2ASqU/XENd1W VjHTzQk6fdCXMm7egNomla7AWjx3FAapdr5DAe9/w2W3gu41dPWzVbSPPdmqAiGX7X vsBe0eYVF4CUyw6QWvkUud87z5SItFlEPLuJUN1HAkuAMNS8ZG12fRHxt5VzXcwQ/r aiXMgEx/AFwMw== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 25 Jul 2024 22:46:58 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: dmitry.torokhov@gmail.com, vipulkumar.samar@st.com, viresh.kumar@linaro.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 1/2] Input: spear-keyboard - Fix a double put in spear_kbd_remove() Date: Thu, 25 Jul 2024 22:46:49 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 The 'input_dev' is a managed resource allocated with devm_input_allocate_device(), so there is no need to call input_unregister_device() in the remove function. In fact, this call was correctly removed in commit 6102752eb354 ("Input: spear-keyboard - switch to using managed resources"), but silently re-introduced later in the commit in Fixes. Fixes: 9336648978c2 ("Input: spear-keyboard - add clk_{un}prepare() support") Signed-off-by: Christophe JAILLET --- Compile tested-only --- drivers/input/keyboard/spear-keyboard.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 557d00a667ce..5d9fc8dc9433 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -276,7 +276,6 @@ static void spear_kbd_remove(struct platform_device *pdev) { struct spear_kbd *kbd = platform_get_drvdata(pdev); - input_unregister_device(kbd->input); clk_unprepare(kbd->clk); } From patchwork Thu Jul 25 20:46:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christophe JAILLET X-Patchwork-Id: 13742151 Received: from msa.smtpout.orange.fr (smtp-77.smtpout.orange.fr [80.12.242.77]) (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 99647E556 for ; Thu, 25 Jul 2024 20:47:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=80.12.242.77 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721940434; cv=none; b=B7j6QFw8omzEMnGUMbscvSdKFBxOXHDMYqJ1mQf6gWNs8uHYYTXXNN4ER7kkqTQaj4ERmOXlhnivF6g/ixSuzJOeRI4XT9aqgaquJo26LW/QGI+BIPyembRf5QO6NGeYI8Pacw5WONV2kWb45j+ZhmWW8Mt/RTIWTUmWPJ5hO/g= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1721940434; c=relaxed/simple; bh=JHDXKeWytPW/ro4uzW8sk6fYfCOgjS6eqK7o1zZy53g=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=hIVtOe6DOLWHcc/y3QbCzJ9IpS5N82rlD3NhO2LyhOsZybIJQ6JWJuqtk0f7EfJ78bv03ra6orW6VYgQzkHA6TBZAVhZKo1t9G8IeGKh42SDLBMdxI69EWU84pewg+vE1ARNkCC8KW+wxhYEBnV9UiGSkKXqpopQQrA54UVgCUY= 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=JHCHykUz; arc=none smtp.client-ip=80.12.242.77 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="JHCHykUz" Received: from fedora.home ([90.11.132.44]) by smtp.orange.fr with ESMTPA id X5MSsJCR06bu3X5Mbs696W; Thu, 25 Jul 2024 22:47:03 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wanadoo.fr; s=t20230301; t=1721940423; bh=O3ZVT0Ujn9hJ7jDCPbtGlOBgrRHSOXl/SJzBREYLERg=; h=From:To:Subject:Date:Message-ID:MIME-Version; b=JHCHykUzoFQDo6moseWVMxr3phGNAXoZAwrR5hJo0TQIehH5Sw5sR1/P3azDW5VP5 dTFuSjrySH1iW+3GFgjFIM/hbs77WjbjR3f6nE/Hq+YfmD9Z2Y76Jkg6UCUd8Y7klw VSmqzABFeUioO8eKfMvVVJZrOGMjFaeKjgcjm7zcSvQvaw7heh/LwTQckU5k4RMWZU gVCP2t/BNOLhcIxZGuy1rwwK9R+23uIf47QXg5aFkOf4qpG1pWK0HoTaAspcxcvq9m hge9vciqNUvw7jnUvAK0r+j9q1E85f7j+J6GRmIaQNUieQNgTPMUmtloqv9EHALnN2 yf2gq719CMNhA== X-ME-Helo: fedora.home X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 25 Jul 2024 22:47:03 +0200 X-ME-IP: 90.11.132.44 From: Christophe JAILLET To: dmitry.torokhov@gmail.com, vipulkumar.samar@st.com, viresh.kumar@linaro.org Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET Subject: [PATCH 2/2] Input: spear-keyboard - Switch to devm_clk_get_prepared() Date: Thu, 25 Jul 2024 22:46:50 +0200 Message-ID: X-Mailer: git-send-email 2.45.2 In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-input@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Use devm_clk_get_prepared() in order to remove a clk_unprepare() in an error handling path of the probe and completely remove the .remove() function. Signed-off-by: Christophe JAILLET --- Compile tested only. --- drivers/input/keyboard/spear-keyboard.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/drivers/input/keyboard/spear-keyboard.c b/drivers/input/keyboard/spear-keyboard.c index 5d9fc8dc9433..1df4feb8ba01 100644 --- a/drivers/input/keyboard/spear-keyboard.c +++ b/drivers/input/keyboard/spear-keyboard.c @@ -222,7 +222,7 @@ static int spear_kbd_probe(struct platform_device *pdev) if (IS_ERR(kbd->io_base)) return PTR_ERR(kbd->io_base); - kbd->clk = devm_clk_get(&pdev->dev, NULL); + kbd->clk = devm_clk_get_prepared(&pdev->dev, NULL); if (IS_ERR(kbd->clk)) return PTR_ERR(kbd->clk); @@ -255,14 +255,9 @@ static int spear_kbd_probe(struct platform_device *pdev) return error; } - error = clk_prepare(kbd->clk); - if (error) - return error; - error = input_register_device(input_dev); if (error) { dev_err(&pdev->dev, "Unable to register keyboard device\n"); - clk_unprepare(kbd->clk); return error; } @@ -272,13 +267,6 @@ static int spear_kbd_probe(struct platform_device *pdev) return 0; } -static void spear_kbd_remove(struct platform_device *pdev) -{ - struct spear_kbd *kbd = platform_get_drvdata(pdev); - - clk_unprepare(kbd->clk); -} - static int spear_kbd_suspend(struct device *dev) { struct platform_device *pdev = to_platform_device(dev); @@ -372,7 +360,6 @@ MODULE_DEVICE_TABLE(of, spear_kbd_id_table); static struct platform_driver spear_kbd_driver = { .probe = spear_kbd_probe, - .remove_new = spear_kbd_remove, .driver = { .name = "keyboard", .pm = pm_sleep_ptr(&spear_kbd_pm_ops),