Message ID | 20230313075430.2730803-3-u.kleine-koenig@pengutronix.de |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp1060039wrd; Mon, 13 Mar 2023 01:18:59 -0700 (PDT) X-Google-Smtp-Source: AK7set+sGwFi1YYZ/c4JhQrkkRmqClvK936nRU3SM33HXSAewmpoXGLyCwyUmMYuhe1cKQ+GLNmZ X-Received: by 2002:a05:6a21:3385:b0:cd:238f:4f4b with SMTP id yy5-20020a056a21338500b000cd238f4f4bmr35615579pzb.23.1678695539595; Mon, 13 Mar 2023 01:18:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678695539; cv=none; d=google.com; s=arc-20160816; b=LgB0r0uuHce7HphseTZst+u3pfsybLW4qF67qUaqkWIlsoYt5z8BIKCGeoMMsRJM+T CHrM4afK2omaHbnruFBtIBWuSYxZQFAjty+zkdpnyUwwHRYFZIKKnm3j8QBHrGqb7P7r PpQhsSKyCZb1Pr4f4kp1Gzf6RL+c1dOW9EBICn/YUpjHdnai7IcONqHa6XBDHYvcXMBR SnrPcplzIH+42dCD25jNRoxRMYGNeNj2u/Ab7GsGErPwPhOR4h4R0JklC9Kaysjp3ilf BwQstTMBvTe0ZM6e3KvjbyRzvM+5pOPsU3AAsTC3X6PA++AJZgWOjcIU7WFvmLxE/bRl 3Xjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=mBKmAv6/O12W31aye0Wsbvmz+sBHicPNJ22jzEmLWWk=; b=e5+fz4JToEOizGLUso3BNuMS3gwXRemdUiPDOi9RqQyb8GvrDTOrA7U92m+KUhY9kv b4CgNzu/CUDmFrJdQeRpiN4cl6N0QvC0aBQHSsQ7gnLFOhkjHIeyKtXWm0I96GOWUswl VJZnacbAO/7zU1/vgX7WBRKJbV+yOVqqKrlYZYn/vOkstFhce9uJC7P1+wkOASnca+v8 w/tSqZJJa5m4dobSDqPX8oPYFik3fXdkG+oQ5jZJrjVGss5ANf0+d6yV6SITPylvVAjE i+x5zFFG8L+nkm4MipqEq/zNE+uXEW5BITrK7fOLhqfJXNPZ84EDGAkZnXeeBW9Q9Qzb 7r/Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u64-20020a638543000000b00502d7941026si5945873pgd.442.2023.03.13.01.18.44; Mon, 13 Mar 2023 01:18:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230348AbjCMH5A (ORCPT <rfc822;realc9580@gmail.com> + 99 others); Mon, 13 Mar 2023 03:57:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49796 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229960AbjCMH41 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Mon, 13 Mar 2023 03:56:27 -0400 Received: from metis.ext.pengutronix.de (metis.ext.pengutronix.de [IPv6:2001:67c:670:201:290:27ff:fe1d:cc33]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2629826C2D for <linux-kernel@vger.kernel.org>; Mon, 13 Mar 2023 00:54:43 -0700 (PDT) Received: from drehscheibe.grey.stw.pengutronix.de ([2a0a:edc0:0:c01:1d::a2]) by metis.ext.pengutronix.de with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from <ukl@pengutronix.de>) id 1pbd0x-0001j9-9v; Mon, 13 Mar 2023 08:54:39 +0100 Received: from [2a0a:edc0:0:900:1d::77] (helo=ptz.office.stw.pengutronix.de) by drehscheibe.grey.stw.pengutronix.de with esmtp (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1pbd0v-003nag-Vy; Mon, 13 Mar 2023 08:54:38 +0100 Received: from ukl by ptz.office.stw.pengutronix.de with local (Exim 4.94.2) (envelope-from <ukl@pengutronix.de>) id 1pbd0v-004TOd-2l; Mon, 13 Mar 2023 08:54:37 +0100 From: =?utf-8?q?Uwe_Kleine-K=C3=B6nig?= <u.kleine-koenig@pengutronix.de> To: Daniel Lezcano <daniel.lezcano@linaro.org>, Thomas Gleixner <tglx@linutronix.de>, Maxime Coquelin <mcoquelin.stm32@gmail.com>, Alexandre Torgue <alexandre.torgue@foss.st.com> Cc: linux-kernel@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org Subject: [PATCH 2/5] clocksource: timer-stm32-lp: Mark driver as non-removable Date: Mon, 13 Mar 2023 08:54:27 +0100 Message-Id: <20230313075430.2730803-3-u.kleine-koenig@pengutronix.de> X-Mailer: git-send-email 2.39.1 In-Reply-To: <20230313075430.2730803-1-u.kleine-koenig@pengutronix.de> References: <20230313075430.2730803-1-u.kleine-koenig@pengutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Developer-Signature: v=1; a=openpgp-sha256; l=1742; i=u.kleine-koenig@pengutronix.de; h=from:subject; bh=1luB8f8PtkOpiikyFH9Ccwu5voPX5s7Env0wEM4st1Q=; b=owEBbQGS/pANAwAKAcH8FHityuwJAcsmYgBkDtapEmix1GST9R/1wht2UbNbrXGI69ZtbBJbq V9jmYN/gUyJATMEAAEKAB0WIQR+cioWkBis/z50pAvB/BR4rcrsCQUCZA7WqQAKCRDB/BR4rcrs CV9RB/4oYsjBQdpRw13S9H4gWYZjxGBXoOYAtrllTOalI8CmLFSgeICD0BZWUgRNA63uoHiT62p OXpp7ZnYi7V2s5aJbgfPy9HX2Bx5szg/vM+G5b+JEjcIL0Gl9o2DDcD5ooNsCpbcdpLXq1uMVkD WTKx12w4o8TyIq3+2nzDzMtC2Kdg38ZLpSg/reKLE3m+NSm3jikgbx7PuMmj0BpnWcWMUx9LXAi g7hx+V9PbwNAd4ainqYlIvM+WNnJ6dw3YJHHWxL6wMFjFerSRfZUQL87eI0DnT5bYglDystMsjw 9TbSe9/OXtZqT0463PvbnLTCoOHKzUJfIi9mZIxyRbAQ4MTH X-Developer-Key: i=u.kleine-koenig@pengutronix.de; a=openpgp; fpr=0D2511F322BFAB1C1580266BE2DCDD9132669BD6 Content-Transfer-Encoding: 8bit X-SA-Exim-Connect-IP: 2a0a:edc0:0:c01:1d::a2 X-SA-Exim-Mail-From: ukl@pengutronix.de X-SA-Exim-Scanned: No (on metis.ext.pengutronix.de); SAEximRunCond expanded to false X-PTX-Original-Recipient: linux-kernel@vger.kernel.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760239853917016185?= X-GMAIL-MSGID: =?utf-8?q?1760239853917016185?= |
Series |
clocksource: Convert to platform remove callback returning void
|
|
Commit Message
Uwe Kleine-König
March 13, 2023, 7:54 a.m. UTC
The comment in the remove callback suggests that the driver is not
supposed to be unbound. However returning an error code in the remove
callback doesn't accomplish that. Instead set the suppress_bind_attrs
property (which makes it impossible to unbind the driver via sysfs).
The only remaining way to unbind an stm32-lp device would be module
unloading, but that doesn't apply here, as the driver cannot be built as
a module.
Also drop the useless remove callback.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
drivers/clocksource/timer-stm32-lp.c | 7 +------
1 file changed, 1 insertion(+), 6 deletions(-)
Comments
Hello, On Mon, Mar 13, 2023 at 08:54:27AM +0100, Uwe Kleine-König wrote: > The comment in the remove callback suggests that the driver is not > supposed to be unbound. However returning an error code in the remove > callback doesn't accomplish that. Instead set the suppress_bind_attrs > property (which makes it impossible to unbind the driver via sysfs). > The only remaining way to unbind an stm32-lp device would be module > unloading, but that doesn't apply here, as the driver cannot be built as > a module. > > Also drop the useless remove callback. > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > --- > drivers/clocksource/timer-stm32-lp.c | 7 +------ > 1 file changed, 1 insertion(+), 6 deletions(-) > > diff --git a/drivers/clocksource/timer-stm32-lp.c b/drivers/clocksource/timer-stm32-lp.c > index db2841d0beb8..616ea4fe4234 100644 > --- a/drivers/clocksource/timer-stm32-lp.c > +++ b/drivers/clocksource/timer-stm32-lp.c > @@ -195,11 +195,6 @@ static int stm32_clkevent_lp_probe(struct platform_device *pdev) > return ret; > } > > -static int stm32_clkevent_lp_remove(struct platform_device *pdev) > -{ > - return -EBUSY; /* cannot unregister clockevent */ > -} > - > static const struct of_device_id stm32_clkevent_lp_of_match[] = { > { .compatible = "st,stm32-lptimer-timer", }, > {}, > @@ -207,11 +202,11 @@ static const struct of_device_id stm32_clkevent_lp_of_match[] = { > MODULE_DEVICE_TABLE(of, stm32_clkevent_lp_of_match); > > static struct platform_driver stm32_clkevent_lp_driver = { > - .probe = stm32_clkevent_lp_probe, > .remove = stm32_clkevent_lp_remove, This is of course broken, I intended to drop the remove line ... and only noticed that breakage after sending out the patch set :-\ So please either skip this patch, or fixup while applying. If you do the former I'll come back to this driver and send a fixed patch. Best regards and sorry Uwe
Hi Uwe,
I love your patch! Yet something to improve:
[auto build test ERROR on fe15c26ee26efa11741a7b632e9f23b01aca4cc6]
url: https://github.com/intel-lab-lkp/linux/commits/Uwe-Kleine-K-nig/clocksource-sh_mtu2-Mark-driver-as-non-removable/20230313-155913
base: fe15c26ee26efa11741a7b632e9f23b01aca4cc6
patch link: https://lore.kernel.org/r/20230313075430.2730803-3-u.kleine-koenig%40pengutronix.de
patch subject: [PATCH 2/5] clocksource: timer-stm32-lp: Mark driver as non-removable
config: m68k-allyesconfig (https://download.01.org/0day-ci/archive/20230313/202303132013.6jB1U6Dg-lkp@intel.com/config)
compiler: m68k-linux-gcc (GCC) 12.1.0
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# https://github.com/intel-lab-lkp/linux/commit/d4016ca907c0dd473c1f28ce43f4ef2495cf1dd5
git remote add linux-review https://github.com/intel-lab-lkp/linux
git fetch --no-tags linux-review Uwe-Kleine-K-nig/clocksource-sh_mtu2-Mark-driver-as-non-removable/20230313-155913
git checkout d4016ca907c0dd473c1f28ce43f4ef2495cf1dd5
# save the config file
mkdir build_dir && cp config build_dir/.config
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k olddefconfig
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=m68k SHELL=/bin/bash drivers/
If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@intel.com>
| Link: https://lore.kernel.org/oe-kbuild-all/202303132013.6jB1U6Dg-lkp@intel.com/
All errors (new ones prefixed by >>):
>> drivers/clocksource/timer-stm32-lp.c:205:19: error: 'stm32_clkevent_lp_remove' undeclared here (not in a function); did you mean 'stm32_clkevent_lp_probe'?
205 | .remove = stm32_clkevent_lp_remove,
| ^~~~~~~~~~~~~~~~~~~~~~~~
| stm32_clkevent_lp_probe
drivers/clocksource/timer-stm32-lp.c:142:12: warning: 'stm32_clkevent_lp_probe' defined but not used [-Wunused-function]
142 | static int stm32_clkevent_lp_probe(struct platform_device *pdev)
| ^~~~~~~~~~~~~~~~~~~~~~~
vim +205 drivers/clocksource/timer-stm32-lp.c
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 203
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 204 static struct platform_driver stm32_clkevent_lp_driver = {
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 @205 .remove = stm32_clkevent_lp_remove,
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 206 .driver = {
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 207 .name = "stm32-lptimer-timer",
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 208 .of_match_table = of_match_ptr(stm32_clkevent_lp_of_match),
d4016ca907c0dd Uwe Kleine-König 2023-03-13 209 .suppress_bind_attrs = true,
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 210 },
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 211 };
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 212 module_platform_driver(stm32_clkevent_lp_driver);
48b41c5e2de6c5 Benjamin Gaignard 2020-06-03 213
diff --git a/drivers/clocksource/timer-stm32-lp.c b/drivers/clocksource/timer-stm32-lp.c index db2841d0beb8..616ea4fe4234 100644 --- a/drivers/clocksource/timer-stm32-lp.c +++ b/drivers/clocksource/timer-stm32-lp.c @@ -195,11 +195,6 @@ static int stm32_clkevent_lp_probe(struct platform_device *pdev) return ret; } -static int stm32_clkevent_lp_remove(struct platform_device *pdev) -{ - return -EBUSY; /* cannot unregister clockevent */ -} - static const struct of_device_id stm32_clkevent_lp_of_match[] = { { .compatible = "st,stm32-lptimer-timer", }, {}, @@ -207,11 +202,11 @@ static const struct of_device_id stm32_clkevent_lp_of_match[] = { MODULE_DEVICE_TABLE(of, stm32_clkevent_lp_of_match); static struct platform_driver stm32_clkevent_lp_driver = { - .probe = stm32_clkevent_lp_probe, .remove = stm32_clkevent_lp_remove, .driver = { .name = "stm32-lptimer-timer", .of_match_table = of_match_ptr(stm32_clkevent_lp_of_match), + .suppress_bind_attrs = true, }, }; module_platform_driver(stm32_clkevent_lp_driver);