* [PATCH V2] platforms/83xx: Use of_device_get_match_data()
@ 2022-02-25 1:07 ` cgel.zte
0 siblings, 0 replies; 6+ messages in thread
From: cgel.zte @ 2022-02-25 1:07 UTC (permalink / raw)
To: oss; +Cc: mpe, benh, linuxppc-dev, linux-kernel, Minghao Chi, Zeal Robot
From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Use of_device_get_match_data() to simplify the code.
v1->v2:
Add a judgment on the return value of the A function as NULL
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
---
arch/powerpc/platforms/83xx/suspend.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index bb147d34d4a6..6d47a5b81485 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -322,18 +322,15 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = {
static const struct of_device_id pmc_match[];
static int pmc_probe(struct platform_device *ofdev)
{
- const struct of_device_id *match;
struct device_node *np = ofdev->dev.of_node;
struct resource res;
const struct pmc_type *type;
int ret = 0;
- match = of_match_device(pmc_match, &ofdev->dev);
- if (!match)
+ type = of_device_get_match_data(&ofdev->dev);
+ if (!type)
return -EINVAL;
- type = match->data;
-
if (!of_device_is_available(np))
return -ENODEV;
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH V2] platforms/83xx: Use of_device_get_match_data()
@ 2022-02-25 1:07 ` cgel.zte
0 siblings, 0 replies; 6+ messages in thread
From: cgel.zte @ 2022-02-25 1:07 UTC (permalink / raw)
To: oss; +Cc: Zeal Robot, linux-kernel, Minghao Chi, linuxppc-dev
From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
Use of_device_get_match_data() to simplify the code.
v1->v2:
Add a judgment on the return value of the A function as NULL
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
---
arch/powerpc/platforms/83xx/suspend.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
index bb147d34d4a6..6d47a5b81485 100644
--- a/arch/powerpc/platforms/83xx/suspend.c
+++ b/arch/powerpc/platforms/83xx/suspend.c
@@ -322,18 +322,15 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = {
static const struct of_device_id pmc_match[];
static int pmc_probe(struct platform_device *ofdev)
{
- const struct of_device_id *match;
struct device_node *np = ofdev->dev.of_node;
struct resource res;
const struct pmc_type *type;
int ret = 0;
- match = of_match_device(pmc_match, &ofdev->dev);
- if (!match)
+ type = of_device_get_match_data(&ofdev->dev);
+ if (!type)
return -EINVAL;
- type = match->data;
-
if (!of_device_is_available(np))
return -ENODEV;
--
2.25.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH V2] platforms/83xx: Use of_device_get_match_data()
2022-02-25 1:07 ` cgel.zte
@ 2022-05-24 11:09 ` Michael Ellerman
-1 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2022-05-24 11:09 UTC (permalink / raw)
To: cgel.zte, oss
Cc: linux-kernel, benh, Zeal Robot, Minghao Chi, mpe, linuxppc-dev
On Fri, 25 Feb 2022 01:07:37 +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
>
> Use of_device_get_match_data() to simplify the code.
> v1->v2:
> Add a judgment on the return value of the A function as NULL
>
>
> [...]
Applied to powerpc/next.
[1/1] platforms/83xx: Use of_device_get_match_data()
https://git.kernel.org/powerpc/c/8a57c3cc2bcb8df98c239d6804fd01834960b7d2
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V2] platforms/83xx: Use of_device_get_match_data()
@ 2022-05-24 11:09 ` Michael Ellerman
0 siblings, 0 replies; 6+ messages in thread
From: Michael Ellerman @ 2022-05-24 11:09 UTC (permalink / raw)
To: cgel.zte, oss; +Cc: Zeal Robot, linux-kernel, Minghao Chi, linuxppc-dev
On Fri, 25 Feb 2022 01:07:37 +0000, cgel.zte@gmail.com wrote:
> From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
>
> Use of_device_get_match_data() to simplify the code.
> v1->v2:
> Add a judgment on the return value of the A function as NULL
>
>
> [...]
Applied to powerpc/next.
[1/1] platforms/83xx: Use of_device_get_match_data()
https://git.kernel.org/powerpc/c/8a57c3cc2bcb8df98c239d6804fd01834960b7d2
cheers
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V2] platforms/83xx: Use of_device_get_match_data()
2022-02-25 1:07 ` cgel.zte
@ 2022-05-24 20:24 ` Christophe JAILLET
-1 siblings, 0 replies; 6+ messages in thread
From: Christophe JAILLET @ 2022-05-24 20:24 UTC (permalink / raw)
To: cgel.zte, oss
Cc: mpe, benh, linuxppc-dev, linux-kernel, Minghao Chi, Zeal Robot
Le 25/02/2022 à 02:07, cgel.zte@gmail.com a écrit :
> From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
>
> Use of_device_get_match_data() to simplify the code.
> v1->v2:
> Add a judgment on the return value of the A function as NULL
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
> ---
> arch/powerpc/platforms/83xx/suspend.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
> index bb147d34d4a6..6d47a5b81485 100644
> --- a/arch/powerpc/platforms/83xx/suspend.c
> +++ b/arch/powerpc/platforms/83xx/suspend.c
> @@ -322,18 +322,15 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = {
> static const struct of_device_id pmc_match[];
Hi,
I think that the line above can now be removed as well.
just my 2c.
CJ
> static int pmc_probe(struct platform_device *ofdev)
> {
> - const struct of_device_id *match;
> struct device_node *np = ofdev->dev.of_node;
> struct resource res;
> const struct pmc_type *type;
> int ret = 0;
>
> - match = of_match_device(pmc_match, &ofdev->dev);
> - if (!match)
> + type = of_device_get_match_data(&ofdev->dev);
> + if (!type)
> return -EINVAL;
>
> - type = match->data;
> -
> if (!of_device_is_available(np))
> return -ENODEV;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V2] platforms/83xx: Use of_device_get_match_data()
@ 2022-05-24 20:24 ` Christophe JAILLET
0 siblings, 0 replies; 6+ messages in thread
From: Christophe JAILLET @ 2022-05-24 20:24 UTC (permalink / raw)
To: cgel.zte, oss; +Cc: Zeal Robot, linux-kernel, Minghao Chi, linuxppc-dev
Le 25/02/2022 à 02:07, cgel.zte@gmail.com a écrit :
> From: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
>
> Use of_device_get_match_data() to simplify the code.
> v1->v2:
> Add a judgment on the return value of the A function as NULL
>
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn>
> ---
> arch/powerpc/platforms/83xx/suspend.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/platforms/83xx/suspend.c b/arch/powerpc/platforms/83xx/suspend.c
> index bb147d34d4a6..6d47a5b81485 100644
> --- a/arch/powerpc/platforms/83xx/suspend.c
> +++ b/arch/powerpc/platforms/83xx/suspend.c
> @@ -322,18 +322,15 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = {
> static const struct of_device_id pmc_match[];
Hi,
I think that the line above can now be removed as well.
just my 2c.
CJ
> static int pmc_probe(struct platform_device *ofdev)
> {
> - const struct of_device_id *match;
> struct device_node *np = ofdev->dev.of_node;
> struct resource res;
> const struct pmc_type *type;
> int ret = 0;
>
> - match = of_match_device(pmc_match, &ofdev->dev);
> - if (!match)
> + type = of_device_get_match_data(&ofdev->dev);
> + if (!type)
> return -EINVAL;
>
> - type = match->data;
> -
> if (!of_device_is_available(np))
> return -ENODEV;
>
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2022-05-24 20:32 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25 1:07 [PATCH V2] platforms/83xx: Use of_device_get_match_data() cgel.zte
2022-02-25 1:07 ` cgel.zte
2022-05-24 11:09 ` Michael Ellerman
2022-05-24 11:09 ` Michael Ellerman
2022-05-24 20:24 ` Christophe JAILLET
2022-05-24 20:24 ` Christophe JAILLET
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.