Received: by 2002:a05:6602:18e:0:0:0:0 with SMTP id m14csp4186667ioo; Wed, 25 May 2022 17:46:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx5wLrIuk4mGQYohNjDZnzgyJbgHGMDZIomvCC/hsz7A4wAiUIOD24rN0gSdTfzZZKkbQMf X-Received: by 2002:aa7:cdd2:0:b0:42b:aeb2:bc99 with SMTP id h18-20020aa7cdd2000000b0042baeb2bc99mr8259977edw.382.1653525994734; Wed, 25 May 2022 17:46:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653525994; cv=none; d=google.com; s=arc-20160816; b=y0G5VELg2iKp9PYQ4PL6/1cNIB7MlRfYJ4E5YZP0MWvCHZVV/B4dG+SwrYVi1oxsuL NIjri4z0ZrV4N45DLAzetmMy3Ctxpi09SzcVBYs0mGoCp4v0XtqG3KGwEz7McgYF1axR TnYORWe4tNfS0Kn8iJ6wpuQ9LJiNwfhJKmj+sh1KV6DSaNC9iwZpMcpVfjGqeWMrkjye p92f4vi10HAY/lSaQRHNT3K8uL0Gs/vWrU6QjZpxCEDc6NcEuzO3VquhYIyXhqT6FdYo tn8EOnoSKCvRBzCFMnlJ+DNumEZEgH9FQ/j0ByVHb7Uc6TqJu61wbCFvkHwWGA36LqMG yrFg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=Ka962JJ9rnMLI1Orj2ezxMjlTy8ciz2v3L1Gu9+BtgQ=; b=JLH7rObFuV0S+xdEvs0GdllLE03ntihH4BihSNWTKuM0imxa9TinnMZbVJSOTNEjFe OYMaBbbq5ZR40f6ZKKZJXnRKDMU5S0aTF+TynUw+uJ/RnyXrt3ru2qwuNycDOIUu0R89 jR+q46mLphGOz/0sCzYQ5X6PRLTNI/ZOzkXTK9wrDXk8XkvLZn/YyKt2oNttLjJkjcx4 pJKY2All3sdU0jsdYqqqokveF6YWIs3JzOcuwjZS1ffZ7EUw0TbACjSXdfv9T6BJHmuO 6CyYGcK2la9EK3CBdMPjh5gpssd8TDtFQrJVU/FbzJnbyWlPRcF/kL3T3LX+ZFnIN9gG Hc3Q== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f4-20020aa7d844000000b0042ad3d82ed2si86024eds.506.2022.05.25.17.46.09; Wed, 25 May 2022 17:46:34 -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 S241411AbiEXUYo (ORCPT + 99 others); Tue, 24 May 2022 16:24:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39146 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237701AbiEXUYn (ORCPT ); Tue, 24 May 2022 16:24:43 -0400 Received: from smtp.smtpout.orange.fr (smtp03.smtpout.orange.fr [80.12.242.125]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9E3215C654 for ; Tue, 24 May 2022 13:24:41 -0700 (PDT) Received: from [192.168.1.18] ([90.11.191.102]) by smtp.orange.fr with ESMTPA id tb4xnPisO4Ltqtb4xnh97t; Tue, 24 May 2022 22:24:36 +0200 X-ME-Helo: [192.168.1.18] X-ME-Auth: YWZlNiIxYWMyZDliZWIzOTcwYTEyYzlhMmU3ZiQ1M2U2MzfzZDfyZTMxZTBkMTYyNDBjNDJlZmQ3ZQ== X-ME-Date: Tue, 24 May 2022 22:24:36 +0200 X-ME-IP: 90.11.191.102 Message-ID: <27777e38-5967-6c87-210a-626461ec125c@wanadoo.fr> Date: Tue, 24 May 2022 22:24:31 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Subject: Re: [PATCH V2] platforms/83xx: Use of_device_get_match_data() Content-Language: en-GB To: cgel.zte@gmail.com, oss@buserror.net Cc: mpe@ellerman.id.au, benh@kernel.crashing.org, linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, Minghao Chi , Zeal Robot References: <20220225010737.2038781-1-chi.minghao@zte.com.cn> From: Christophe JAILLET In-Reply-To: <20220225010737.2038781-1-chi.minghao@zte.com.cn> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE 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: X-Mailing-List: linux-kernel@vger.kernel.org Le 25/02/2022 à 02:07, cgel.zte@gmail.com a écrit : > From: Minghao Chi (CGEL ZTE) > > 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 > Signed-off-by: Minghao Chi (CGEL ZTE) > --- > 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; >