diff mbox series

[1/3] powerpc/platforms/83xx/suspend: Reorder to get rid of a forward declaration

Message ID 20220707061441.193869-1-u.kleine-koenig@pengutronix.de (mailing list archive)
State Accepted
Headers show
Series [1/3] powerpc/platforms/83xx/suspend: Reorder to get rid of a forward declaration | expand

Commit Message

Uwe Kleine-König July 7, 2022, 6:14 a.m. UTC
By moving up pmc_types and pmc_match, the forward declaration for pmc_match
can be dropped.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 arch/powerpc/platforms/83xx/suspend.c | 43 +++++++++++++--------------
 1 file changed, 21 insertions(+), 22 deletions(-)


base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56

Comments

Christophe Leroy July 7, 2022, 8:43 a.m. UTC | #1
Le 07/07/2022 à 08:14, Uwe Kleine-König a écrit :
> By moving up pmc_types and pmc_match, the forward declaration for pmc_match
> can be dropped.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Christophe Leroy <christophe.leroy@csgroup.eu>

> ---
>   arch/powerpc/platforms/83xx/suspend.c | 43 +++++++++++++--------------
>   1 file changed, 21 insertions(+), 22 deletions(-)
> 
> diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
> index 6d47a5b81485..30b7700a2c98 100644
> --- a/arch/powerpc/platforms/83xx/suspend.c
> +++ b/arch/powerpc/platforms/83xx/suspend.c
> @@ -319,7 +319,27 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = {
>   	.end = mpc83xx_suspend_end,
>   };
>   
> -static const struct of_device_id pmc_match[];
> +static struct pmc_type pmc_types[] = {
> +	{
> +		.has_deep_sleep = 1,
> +	},
> +	{
> +		.has_deep_sleep = 0,
> +	}
> +};
> +
> +static const struct of_device_id pmc_match[] = {
> +	{
> +		.compatible = "fsl,mpc8313-pmc",
> +		.data = &pmc_types[0],
> +	},
> +	{
> +		.compatible = "fsl,mpc8349-pmc",
> +		.data = &pmc_types[1],
> +	},
> +	{}
> +};
> +
>   static int pmc_probe(struct platform_device *ofdev)
>   {
>   	struct device_node *np = ofdev->dev.of_node;
> @@ -406,27 +426,6 @@ static int pmc_remove(struct platform_device *ofdev)
>   	return -EPERM;
>   };
>   
> -static struct pmc_type pmc_types[] = {
> -	{
> -		.has_deep_sleep = 1,
> -	},
> -	{
> -		.has_deep_sleep = 0,
> -	}
> -};
> -
> -static const struct of_device_id pmc_match[] = {
> -	{
> -		.compatible = "fsl,mpc8313-pmc",
> -		.data = &pmc_types[0],
> -	},
> -	{
> -		.compatible = "fsl,mpc8349-pmc",
> -		.data = &pmc_types[1],
> -	},
> -	{}
> -};
> -
>   static struct platform_driver pmc_driver = {
>   	.driver = {
>   		.name = "mpc83xx-pmc",
> 
> base-commit: f2906aa863381afb0015a9eb7fefad885d4e5a56
Michael Ellerman July 29, 2022, 1:03 p.m. UTC | #2
On Thu, 7 Jul 2022 08:14:39 +0200, Uwe Kleine-König wrote:
> By moving up pmc_types and pmc_match, the forward declaration for pmc_match
> can be dropped.
> 
> 

Applied to powerpc/next.

[1/3] powerpc/platforms/83xx/suspend: Reorder to get rid of a forward declaration
      https://git.kernel.org/powerpc/c/fde345e4d39a4f16697a8060564fff1dbac05035
[2/3] powerpc/platforms/83xx/suspend: Prevent unloading the driver
      https://git.kernel.org/powerpc/c/ccc1439b924bca5d5a5d81cf6b0d4b10b321282e
[3/3] powerpc/platforms/83xx/suspend: Remove write-only global variable
      https://git.kernel.org/powerpc/c/95b002e4e47a36d88deec70808ef36674fb33cf5

cheers
diff mbox series

Patch

diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index 6d47a5b81485..30b7700a2c98 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -319,7 +319,27 @@  static const struct platform_suspend_ops mpc83xx_suspend_ops = {
 	.end = mpc83xx_suspend_end,
 };
 
-static const struct of_device_id pmc_match[];
+static struct pmc_type pmc_types[] = {
+	{
+		.has_deep_sleep = 1,
+	},
+	{
+		.has_deep_sleep = 0,
+	}
+};
+
+static const struct of_device_id pmc_match[] = {
+	{
+		.compatible = "fsl,mpc8313-pmc",
+		.data = &pmc_types[0],
+	},
+	{
+		.compatible = "fsl,mpc8349-pmc",
+		.data = &pmc_types[1],
+	},
+	{}
+};
+
 static int pmc_probe(struct platform_device *ofdev)
 {
 	struct device_node *np = ofdev->dev.of_node;
@@ -406,27 +426,6 @@  static int pmc_remove(struct platform_device *ofdev)
 	return -EPERM;
 };
 
-static struct pmc_type pmc_types[] = {
-	{
-		.has_deep_sleep = 1,
-	},
-	{
-		.has_deep_sleep = 0,
-	}
-};
-
-static const struct of_device_id pmc_match[] = {
-	{
-		.compatible = "fsl,mpc8313-pmc",
-		.data = &pmc_types[0],
-	},
-	{
-		.compatible = "fsl,mpc8349-pmc",
-		.data = &pmc_types[1],
-	},
-	{}
-};
-
 static struct platform_driver pmc_driver = {
 	.driver = {
 		.name = "mpc83xx-pmc",