* [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy()
@ 2022-10-31 5:06 Tzung-Bi Shih
2022-10-31 15:20 ` Guenter Roeck
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Tzung-Bi Shih @ 2022-10-31 5:06 UTC (permalink / raw)
To: bleung, groeck; +Cc: chrome-platform, briannorris, tzungbi
It's pointless (and invalid) to destroy a statically allocated mutex in
cros_ec_lpc_mec_destroy().
Let's remove it.
Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
---
A follow up from https://patchwork.kernel.org/project/chrome-platform/patch/20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid/.
drivers/platform/chrome/cros_ec_lpc.c | 3 ---
drivers/platform/chrome/cros_ec_lpc_mec.c | 6 ------
drivers/platform/chrome/cros_ec_lpc_mec.h | 7 -------
drivers/platform/chrome/wilco_ec/core.c | 5 -----
4 files changed, 21 deletions(-)
diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
index 7677ab3c0ead..6ef5e5d40ba4 100644
--- a/drivers/platform/chrome/cros_ec_lpc.c
+++ b/drivers/platform/chrome/cros_ec_lpc.c
@@ -593,7 +593,6 @@ static int __init cros_ec_lpc_init(void)
ret = platform_driver_register(&cros_ec_lpc_driver);
if (ret) {
pr_err(DRV_NAME ": can't register driver: %d\n", ret);
- cros_ec_lpc_mec_destroy();
return ret;
}
@@ -603,7 +602,6 @@ static int __init cros_ec_lpc_init(void)
if (ret) {
pr_err(DRV_NAME ": can't register device: %d\n", ret);
platform_driver_unregister(&cros_ec_lpc_driver);
- cros_ec_lpc_mec_destroy();
}
}
@@ -615,7 +613,6 @@ static void __exit cros_ec_lpc_exit(void)
if (!cros_ec_lpc_acpi_device_found)
platform_device_unregister(&cros_ec_lpc_device);
platform_driver_unregister(&cros_ec_lpc_driver);
- cros_ec_lpc_mec_destroy();
}
module_init(cros_ec_lpc_init);
diff --git a/drivers/platform/chrome/cros_ec_lpc_mec.c b/drivers/platform/chrome/cros_ec_lpc_mec.c
index bbc2884f5e2f..0d9c79b270ce 100644
--- a/drivers/platform/chrome/cros_ec_lpc_mec.c
+++ b/drivers/platform/chrome/cros_ec_lpc_mec.c
@@ -146,9 +146,3 @@ void cros_ec_lpc_mec_init(unsigned int base, unsigned int end)
mec_emi_end = end;
}
EXPORT_SYMBOL(cros_ec_lpc_mec_init);
-
-void cros_ec_lpc_mec_destroy(void)
-{
- mutex_destroy(&io_mutex);
-}
-EXPORT_SYMBOL(cros_ec_lpc_mec_destroy);
diff --git a/drivers/platform/chrome/cros_ec_lpc_mec.h b/drivers/platform/chrome/cros_ec_lpc_mec.h
index aa1018f6b0f2..9d0521b23e8a 100644
--- a/drivers/platform/chrome/cros_ec_lpc_mec.h
+++ b/drivers/platform/chrome/cros_ec_lpc_mec.h
@@ -45,13 +45,6 @@ enum cros_ec_lpc_mec_io_type {
*/
void cros_ec_lpc_mec_init(unsigned int base, unsigned int end);
-/*
- * cros_ec_lpc_mec_destroy
- *
- * Cleanup MEC I/O.
- */
-void cros_ec_lpc_mec_destroy(void);
-
/**
* cros_ec_lpc_mec_in_range() - Determine if addresses are in MEC EMI range.
*
diff --git a/drivers/platform/chrome/wilco_ec/core.c b/drivers/platform/chrome/wilco_ec/core.c
index 5b42992bff38..d6a994bdc182 100644
--- a/drivers/platform/chrome/wilco_ec/core.c
+++ b/drivers/platform/chrome/wilco_ec/core.c
@@ -129,7 +129,6 @@ static int wilco_ec_probe(struct platform_device *pdev)
unregister_debugfs:
if (ec->debugfs_pdev)
platform_device_unregister(ec->debugfs_pdev);
- cros_ec_lpc_mec_destroy();
return ret;
}
@@ -143,10 +142,6 @@ static int wilco_ec_remove(struct platform_device *pdev)
platform_device_unregister(ec->rtc_pdev);
if (ec->debugfs_pdev)
platform_device_unregister(ec->debugfs_pdev);
-
- /* Teardown cros_ec interface */
- cros_ec_lpc_mec_destroy();
-
return 0;
}
--
2.38.1.273.g43a17bfeac-goog
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy()
2022-10-31 5:06 [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy() Tzung-Bi Shih
@ 2022-10-31 15:20 ` Guenter Roeck
2022-10-31 16:45 ` Brian Norris
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Guenter Roeck @ 2022-10-31 15:20 UTC (permalink / raw)
To: Tzung-Bi Shih; +Cc: bleung, groeck, chrome-platform, briannorris
On Sun, Oct 30, 2022 at 10:07 PM Tzung-Bi Shih <tzungbi@kernel.org> wrote:
>
> It's pointless (and invalid) to destroy a statically allocated mutex in
> cros_ec_lpc_mec_destroy().
>
> Let's remove it.
>
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
> ---
> A follow up from https://patchwork.kernel.org/project/chrome-platform/patch/20221028141411.1.I0728421299079b104710c202d5d7095b2674fd8c@changeid/.
>
> drivers/platform/chrome/cros_ec_lpc.c | 3 ---
> drivers/platform/chrome/cros_ec_lpc_mec.c | 6 ------
> drivers/platform/chrome/cros_ec_lpc_mec.h | 7 -------
> drivers/platform/chrome/wilco_ec/core.c | 5 -----
> 4 files changed, 21 deletions(-)
>
> diff --git a/drivers/platform/chrome/cros_ec_lpc.c b/drivers/platform/chrome/cros_ec_lpc.c
> index 7677ab3c0ead..6ef5e5d40ba4 100644
> --- a/drivers/platform/chrome/cros_ec_lpc.c
> +++ b/drivers/platform/chrome/cros_ec_lpc.c
> @@ -593,7 +593,6 @@ static int __init cros_ec_lpc_init(void)
> ret = platform_driver_register(&cros_ec_lpc_driver);
> if (ret) {
> pr_err(DRV_NAME ": can't register driver: %d\n", ret);
> - cros_ec_lpc_mec_destroy();
> return ret;
> }
>
> @@ -603,7 +602,6 @@ static int __init cros_ec_lpc_init(void)
> if (ret) {
> pr_err(DRV_NAME ": can't register device: %d\n", ret);
> platform_driver_unregister(&cros_ec_lpc_driver);
> - cros_ec_lpc_mec_destroy();
> }
> }
>
> @@ -615,7 +613,6 @@ static void __exit cros_ec_lpc_exit(void)
> if (!cros_ec_lpc_acpi_device_found)
> platform_device_unregister(&cros_ec_lpc_device);
> platform_driver_unregister(&cros_ec_lpc_driver);
> - cros_ec_lpc_mec_destroy();
> }
>
> module_init(cros_ec_lpc_init);
> diff --git a/drivers/platform/chrome/cros_ec_lpc_mec.c b/drivers/platform/chrome/cros_ec_lpc_mec.c
> index bbc2884f5e2f..0d9c79b270ce 100644
> --- a/drivers/platform/chrome/cros_ec_lpc_mec.c
> +++ b/drivers/platform/chrome/cros_ec_lpc_mec.c
> @@ -146,9 +146,3 @@ void cros_ec_lpc_mec_init(unsigned int base, unsigned int end)
> mec_emi_end = end;
> }
> EXPORT_SYMBOL(cros_ec_lpc_mec_init);
> -
> -void cros_ec_lpc_mec_destroy(void)
> -{
> - mutex_destroy(&io_mutex);
> -}
> -EXPORT_SYMBOL(cros_ec_lpc_mec_destroy);
> diff --git a/drivers/platform/chrome/cros_ec_lpc_mec.h b/drivers/platform/chrome/cros_ec_lpc_mec.h
> index aa1018f6b0f2..9d0521b23e8a 100644
> --- a/drivers/platform/chrome/cros_ec_lpc_mec.h
> +++ b/drivers/platform/chrome/cros_ec_lpc_mec.h
> @@ -45,13 +45,6 @@ enum cros_ec_lpc_mec_io_type {
> */
> void cros_ec_lpc_mec_init(unsigned int base, unsigned int end);
>
> -/*
> - * cros_ec_lpc_mec_destroy
> - *
> - * Cleanup MEC I/O.
> - */
> -void cros_ec_lpc_mec_destroy(void);
> -
> /**
> * cros_ec_lpc_mec_in_range() - Determine if addresses are in MEC EMI range.
> *
> diff --git a/drivers/platform/chrome/wilco_ec/core.c b/drivers/platform/chrome/wilco_ec/core.c
> index 5b42992bff38..d6a994bdc182 100644
> --- a/drivers/platform/chrome/wilco_ec/core.c
> +++ b/drivers/platform/chrome/wilco_ec/core.c
> @@ -129,7 +129,6 @@ static int wilco_ec_probe(struct platform_device *pdev)
> unregister_debugfs:
> if (ec->debugfs_pdev)
> platform_device_unregister(ec->debugfs_pdev);
> - cros_ec_lpc_mec_destroy();
> return ret;
> }
>
> @@ -143,10 +142,6 @@ static int wilco_ec_remove(struct platform_device *pdev)
> platform_device_unregister(ec->rtc_pdev);
> if (ec->debugfs_pdev)
> platform_device_unregister(ec->debugfs_pdev);
> -
> - /* Teardown cros_ec interface */
> - cros_ec_lpc_mec_destroy();
> -
> return 0;
> }
>
> --
> 2.38.1.273.g43a17bfeac-goog
>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy()
2022-10-31 5:06 [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy() Tzung-Bi Shih
2022-10-31 15:20 ` Guenter Roeck
@ 2022-10-31 16:45 ` Brian Norris
2022-11-01 2:40 ` patchwork-bot+chrome-platform
2022-11-01 4:40 ` patchwork-bot+chrome-platform
3 siblings, 0 replies; 5+ messages in thread
From: Brian Norris @ 2022-10-31 16:45 UTC (permalink / raw)
To: Tzung-Bi Shih; +Cc: bleung, groeck, chrome-platform
On Mon, Oct 31, 2022 at 01:06:57PM +0800, Tzung-Bi Shih wrote:
> It's pointless (and invalid) to destroy a statically allocated mutex in
> cros_ec_lpc_mec_destroy().
>
> Let's remove it.
>
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
This whole init()/destroy() thing hiding global state is kind of weird
in the first place, and if this ever properly becomes non-global state,
we might want to have a matching destroy() API back. But for now, this
probably makes more sense.
(Alternatively, one could leave an empty function. But I think that
might hurt someone else's sense of style.)
So:
Reviewed-by: Brian Norris <briannorris@chromium.org>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy()
2022-10-31 5:06 [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy() Tzung-Bi Shih
2022-10-31 15:20 ` Guenter Roeck
2022-10-31 16:45 ` Brian Norris
@ 2022-11-01 2:40 ` patchwork-bot+chrome-platform
2022-11-01 4:40 ` patchwork-bot+chrome-platform
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+chrome-platform @ 2022-11-01 2:40 UTC (permalink / raw)
To: Tzung-Bi Shih; +Cc: bleung, groeck, chrome-platform, briannorris
Hello:
This patch was applied to chrome-platform/linux.git (for-kernelci)
by Tzung-Bi Shih <tzungbi@kernel.org>:
On Mon, 31 Oct 2022 13:06:57 +0800 you wrote:
> It's pointless (and invalid) to destroy a statically allocated mutex in
> cros_ec_lpc_mec_destroy().
>
> Let's remove it.
>
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
>
> [...]
Here is the summary with links:
- platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy()
https://git.kernel.org/chrome-platform/c/9888feb9c68b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy()
2022-10-31 5:06 [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy() Tzung-Bi Shih
` (2 preceding siblings ...)
2022-11-01 2:40 ` patchwork-bot+chrome-platform
@ 2022-11-01 4:40 ` patchwork-bot+chrome-platform
3 siblings, 0 replies; 5+ messages in thread
From: patchwork-bot+chrome-platform @ 2022-11-01 4:40 UTC (permalink / raw)
To: Tzung-Bi Shih; +Cc: bleung, groeck, chrome-platform, briannorris
Hello:
This patch was applied to chrome-platform/linux.git (for-next)
by Tzung-Bi Shih <tzungbi@kernel.org>:
On Mon, 31 Oct 2022 13:06:57 +0800 you wrote:
> It's pointless (and invalid) to destroy a statically allocated mutex in
> cros_ec_lpc_mec_destroy().
>
> Let's remove it.
>
> Signed-off-by: Tzung-Bi Shih <tzungbi@kernel.org>
>
> [...]
Here is the summary with links:
- platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy()
https://git.kernel.org/chrome-platform/c/9888feb9c68b
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2022-11-01 4:40 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-31 5:06 [PATCH] platform/chrome: cros_ec_lpc_mec: remove cros_ec_lpc_mec_destroy() Tzung-Bi Shih
2022-10-31 15:20 ` Guenter Roeck
2022-10-31 16:45 ` Brian Norris
2022-11-01 2:40 ` patchwork-bot+chrome-platform
2022-11-01 4:40 ` patchwork-bot+chrome-platform
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox