Message ID | 202211171511333735699@zte.com.cn |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp256121wrr; Wed, 16 Nov 2022 23:17:15 -0800 (PST) X-Google-Smtp-Source: AA0mqf6Vx4R7wGxoS2hDvHcroE2hvmmAE3b7JoTmHMD3SVK0ISf+2NEiGxR1tHzjMJOLFedTCI4M X-Received: by 2002:a17:902:f152:b0:188:5581:c8de with SMTP id d18-20020a170902f15200b001885581c8demr1454793plb.140.1668669434715; Wed, 16 Nov 2022 23:17:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668669434; cv=none; d=google.com; s=arc-20160816; b=EOujbGZSmNuVQfISL+FuKt+PePYlqpSkKhbeCC4S1hj7JC9QXWFkWlHm8Vh0oCpKb0 ResuM15WXrEqe/3J4/Yt7NYfV/r1SAsWg4MGlkkfElA14AU+5Ni+Wrhu6AZUreuBW8Xx KA5/+HJ4xW8pKL8YXGHUveE/qSQPydF8jfmz1OB1GrLH6xC2w6IJ3/Z2JN/igIMVer8U D2tZPQTsW830sPyo4HLysO/ielyJt9j/lXj5lJpScHWuD0ngqlqxW7EoZPddb1eEGrJy QpzOvcaFYgCBID+UW+HeCLSbcR3UGnF4VP61a01PlKNlJvG8mKNlTjYvBzljnKSxPVX3 KeOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:cc:to:from:mime-version:message-id:date; bh=P280ak0Ax2CR11dg+GPXhrw6Pf9hnVzfZeOU84lMFHY=; b=vdprvX5mtybmI7eHNhQ6z+AsbdkYFRI4pgV4ANf/m6d9XhlCEGOyAdJxDfphZP3RjF lpqQw/p/ozuaAKRJpqdr6UQNkI0ZgzE8Gj/VROM/Q/AUf+wj0F6UHG8J/1Fs+kd2JKlT KIt73gP4vj4FhHn6+9XA/KnF9vwvRGhLFyoS/o5zFoZWIvXjDMsei9DYlCxReCcz6BGj Fi2yCm0CfDjATx5q9ldnkctbaihRkPEFQLvSFDkVkYrHX3+z25rgf1lROEImLRKgDbI7 vopq9YBYSM4rap7cgU2+79yNKXRjyYLOt0M02HXkWJRHqxGE6n9CxGOBxI6Vp2gKWg8b WZZA== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o4-20020a656a44000000b00459ba7ace44si336397pgu.514.2022.11.16.23.17.01; Wed, 16 Nov 2022 23:17:14 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=zte.com.cn Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234241AbiKQHL5 (ORCPT <rfc822;just.gull.subs@gmail.com> + 99 others); Thu, 17 Nov 2022 02:11:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229991AbiKQHLz (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Thu, 17 Nov 2022 02:11:55 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BADF967139 for <linux-kernel@vger.kernel.org>; Wed, 16 Nov 2022 23:11:52 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4NCWLb29t0z5BNS0; Thu, 17 Nov 2022 15:11:51 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.40.50]) by mse-fl2.zte.com.cn with SMTP id 2AH7BV7m075328; Thu, 17 Nov 2022 15:11:31 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Thu, 17 Nov 2022 15:11:33 +0800 (CST) Date: Thu, 17 Nov 2022 15:11:33 +0800 (CST) X-Zmail-TransId: 2af96375dea56961b9ff X-Mailer: Zmail v1.0 Message-ID: <202211171511333735699@zte.com.cn> Mime-Version: 1.0 From: <ye.xingchen@zte.com.cn> To: <p.zabel@pengutronix.de> Cc: <airlied@gmail.com>, <daniel@ffwll.ch>, <shawnguo@kernel.org>, <s.hauer@pengutronix.de>, <kernel@pengutronix.de>, <festevam@gmail.com>, <linux-imx@nxp.com>, <dri-devel@lists.freedesktop.org>, <linux-arm-kernel@lists.infradead.org>, <linux-kernel@vger.kernel.org> Subject: =?utf-8?q?=5BPATCH_linux-next=5D_drm/imx=3A_Use_device=5Fmatch=5Fof?= =?utf-8?q?=5Fnode=28=29?= Content-Type: text/plain; charset="UTF-8" X-MAIL: mse-fl2.zte.com.cn 2AH7BV7m075328 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 6375DEB7.000 by FangMail milter! X-FangMail-Envelope: 1668669111/4NCWLb29t0z5BNS0/6375DEB7.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/<ye.xingchen@zte.com.cn> X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 6375DEB7.000/4NCWLb29t0z5BNS0 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,UNPARSEABLE_RELAY 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749726720820078641?= X-GMAIL-MSGID: =?utf-8?q?1749726720820078641?= |
Series |
[linux-next] drm/imx: Use device_match_of_node()
|
|
Commit Message
ye.xingchen@zte.com.cn
Nov. 17, 2022, 7:11 a.m. UTC
From: ye xingchen <ye.xingchen@zte.com.cn> Replace the open-code with device_match_of_node(). Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> --- drivers/gpu/drm/imx/imx-drm-core.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Comments
Hi, Thank you for the patch! Yet something to improve: [auto build test ERROR on next-20221116] url: https://github.com/intel-lab-lkp/linux/commits/ye-xingchen-zte-com-cn/drm-imx-Use-device_match_of_node/20221117-151254 patch link: https://lore.kernel.org/r/202211171511333735699%40zte.com.cn patch subject: [PATCH linux-next] drm/imx: Use device_match_of_node() config: microblaze-allmodconfig compiler: microblaze-linux-gcc (GCC) 12.1.0 reproduce (this is a W=1 build): wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # https://github.com/intel-lab-lkp/linux/commit/94ad00c926678ebff17e91e24878777fb900936a git remote add linux-review https://github.com/intel-lab-lkp/linux git fetch --no-tags linux-review ye-xingchen-zte-com-cn/drm-imx-Use-device_match_of_node/20221117-151254 git checkout 94ad00c926678ebff17e91e24878777fb900936a # save the config file mkdir build_dir && cp config build_dir/.config COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-12.1.0 make.cross W=1 O=build_dir ARCH=microblaze SHELL=/bin/bash drivers/gpu/drm/imx/ If you fix the issue, kindly add following tag where applicable | Reported-by: kernel test robot <lkp@intel.com> All errors (new ones prefixed by >>): drivers/gpu/drm/imx/imx-drm-core.c: In function 'compare_of': >> drivers/gpu/drm/imx/imx-drm-core.c:185:45: error: passing argument 1 of 'device_match_of_node' from incompatible pointer type [-Werror=incompatible-pointer-types] 185 | return device_match_of_node(pdata, np); | ^~~~~ | | | struct ipu_client_platformdata * In file included from include/linux/device.h:30, from drivers/gpu/drm/imx/imx-drm-core.c:9: include/linux/device/bus.h:145:41: note: expected 'struct device *' but argument is of type 'struct ipu_client_platformdata *' 145 | int device_match_of_node(struct device *dev, const void *np); | ~~~~~~~~~~~~~~~^~~ cc1: some warnings being treated as errors vim +/device_match_of_node +185 drivers/gpu/drm/imx/imx-drm-core.c 176 177 static int compare_of(struct device *dev, void *data) 178 { 179 struct device_node *np = data; 180 181 /* Special case for DI, dev->of_node may not be set yet */ 182 if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) { 183 struct ipu_client_platformdata *pdata = dev->platform_data; 184 > 185 return device_match_of_node(pdata, np); 186 } 187 188 /* Special case for LDB, one device for two channels */ 189 if (of_node_name_eq(np, "lvds-channel")) { 190 np = of_get_parent(np); 191 of_node_put(np); 192 } 193 194 return device_match_of_node(dev, np); 195 } 196
Hello, On 17.11.22 08:11, ye.xingchen@zte.com.cn wrote: > From: ye xingchen <ye.xingchen@zte.com.cn> > > Replace the open-code with device_match_of_node(). device_match_of_node() exists so a pointer to the function can be passed to class/driver_find_device. I see no reason to call it directly. I don't think you should pursue any patches, where you do this transformation even if they pass a compile test unlike the patch here. Thanks, Ahmad > > Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn> > --- > drivers/gpu/drm/imx/imx-drm-core.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c > index e060fa6cbcb9..2e4f5af894b0 100644 > --- a/drivers/gpu/drm/imx/imx-drm-core.c > +++ b/drivers/gpu/drm/imx/imx-drm-core.c > @@ -182,7 +182,7 @@ static int compare_of(struct device *dev, void *data) > if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) { > struct ipu_client_platformdata *pdata = dev->platform_data; > > - return pdata->of_node == np; > + return device_match_of_node(pdata, np); > } > > /* Special case for LDB, one device for two channels */ > @@ -191,7 +191,7 @@ static int compare_of(struct device *dev, void *data) > of_node_put(np); > } > > - return dev->of_node == np; > + return device_match_of_node(dev, np); > } > > static int imx_drm_bind(struct device *dev)
diff --git a/drivers/gpu/drm/imx/imx-drm-core.c b/drivers/gpu/drm/imx/imx-drm-core.c index e060fa6cbcb9..2e4f5af894b0 100644 --- a/drivers/gpu/drm/imx/imx-drm-core.c +++ b/drivers/gpu/drm/imx/imx-drm-core.c @@ -182,7 +182,7 @@ static int compare_of(struct device *dev, void *data) if (strcmp(dev->driver->name, "imx-ipuv3-crtc") == 0) { struct ipu_client_platformdata *pdata = dev->platform_data; - return pdata->of_node == np; + return device_match_of_node(pdata, np); } /* Special case for LDB, one device for two channels */ @@ -191,7 +191,7 @@ static int compare_of(struct device *dev, void *data) of_node_put(np); } - return dev->of_node == np; + return device_match_of_node(dev, np); } static int imx_drm_bind(struct device *dev)