Skip to content

Commit 8a57c3c

Browse files
Minghao Chi (CGEL ZTE)mpe
authored andcommitted
powerpc/platforms/83xx: Use of_device_get_match_data()
Use of_device_get_match_data() to simplify the code. Reported-by: Zeal Robot <zealci@zte.com.cn> Signed-off-by: Minghao Chi (CGEL ZTE) <chi.minghao@zte.com.cn> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Link: https://lore.kernel.org/r/20220225010737.2038781-1-chi.minghao@zte.com.cn
1 parent 3def164 commit 8a57c3c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

arch/powerpc/platforms/83xx/suspend.c

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -322,18 +322,15 @@ static const struct platform_suspend_ops mpc83xx_suspend_ops = {
322322
static const struct of_device_id pmc_match[];
323323
static int pmc_probe(struct platform_device *ofdev)
324324
{
325-
const struct of_device_id *match;
326325
struct device_node *np = ofdev->dev.of_node;
327326
struct resource res;
328327
const struct pmc_type *type;
329328
int ret = 0;
330329

331-
match = of_match_device(pmc_match, &ofdev->dev);
332-
if (!match)
330+
type = of_device_get_match_data(&ofdev->dev);
331+
if (!type)
333332
return -EINVAL;
334333

335-
type = match->data;
336-
337334
if (!of_device_is_available(np))
338335
return -ENODEV;
339336

0 commit comments

Comments
 (0)