Message ID | 20221118185617.33908-1-andriy.shevchenko@linux.intel.com |
---|---|
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 q4csp360074wrr; Fri, 18 Nov 2022 11:03:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf7FbhAYaMac7aDsYzcdxO6ICu8dTxZM0q9J/+Yh37RSV5ahGAaSiAE5mpFg3BmvguJIZmpD X-Received: by 2002:a17:906:6681:b0:7ae:732d:bc51 with SMTP id z1-20020a170906668100b007ae732dbc51mr7096995ejo.549.1668798180357; Fri, 18 Nov 2022 11:03:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668798180; cv=none; d=google.com; s=arc-20160816; b=FXwmEPdOtmT0DrISJqhgr7/PEXrdFtLEgVzbnF/lExRqdhnRpVw0LbIxT+oPcb2a20 J9jsa72tsUs5FYjsQGfYzmODO7wLE0Iy4UQ6JagVNtfUthDHW1x1OVFJLKVdXvFGm+Kp JLZfPEFI9FwNKBEYJCyTrsXoGV18koC5lzYTi+nnc9IrWrdjINFPPvHjH6k4i6tJMi3G wcZY5O0NFLrt9yeXJcnkzTqHKxAfqeLd7u+jRlfoAyNSBKJBKAfAK3c5Z5qxGkSM1snB rTrfaS7YhROf49bipgDbkFYxgdotyr+BrilCi0M4SnJQPLZZvbMZ8mArhSD2pTE86UUs 4qsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=PTEsdUGRcEQ2qtzzQIOOXBYkAkibEUt9wt/nHVDoSmA=; b=oBiX0WAhr0qEhH6aXFNVPhgoJMeeRTbW/HhCc8dgczwsuujJRpk5jT12NxWN2a7a0/ 86Kle1UP1Xi+jH+9s5RagRJS2MOd1RPpSyvLiSoI32NpomqM36LZJ5Twe0BdX93SB6+Y 74bErA45WsrHrDL6kBvN8FiAjQ3DhKAB0dAnMMBpdrPxV+ar6onMdCn5Czy4S2cUw5Ve pO0h/Tt0wn+LLlP08X/TzvglZNeYwJTUwdYOY/VbTFpFB6dEU56zIBiwJ/1SIWJz7aZx ICpRse2w/HjfwW9Vh9enkbMSMavu94kB2+Xtf5vekYrln606Itmf/bqvQCbXEA9m0f0t qDIA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=Ib0lef1d; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa17-20020a170907869100b0078239e3f846si4167215ejc.1.2022.11.18.11.02.25; Fri, 18 Nov 2022 11:03:00 -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; dkim=pass header.i=@intel.com header.s=Intel header.b=Ib0lef1d; 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=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242863AbiKRTBe (ORCPT <rfc822;kkmonlee@gmail.com> + 99 others); Fri, 18 Nov 2022 14:01:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242339AbiKRTBI (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 18 Nov 2022 14:01:08 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0C826233A2; Fri, 18 Nov 2022 11:01:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1668798068; x=1700334068; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=WvZ7SWFh8KHhZL+jsKQNukYdJbXBUPn1qpeTKkRZRVM=; b=Ib0lef1dWTXH8EXl5URnBFrezCwDAZkrJqeaXRjaSTcvEHJlbuCY5JKq jN9/qUkusoXO/Mc7PqS6U1BNvdD6Exl+fRSJR63Ki2EGFdt0oJ3Gaqr1g mnvT9Ghqipa9Yjy+Lq3Q+UFOQpMeEaKKuSrQPbWndUY4nc+GD963gOt3l xyMj2D6HEZM3kU00sChj/OjCh1DahdoxgYKMbkx7cNsTxE0IEnUQfuvYP DCLIJvdg8LmGuu2J5o0wo9Uh4NVC9dL75hyM06YTrHUpU9qxFfyFD0RrJ V21ddroO0wygthtzYBOzK9euXp80zg0jX3HWe+FE0ngCjcH2jCeeB+Mcl Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10535"; a="315028382" X-IronPort-AV: E=Sophos;i="5.96,175,1665471600"; d="scan'208";a="315028382" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 18 Nov 2022 11:01:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10535"; a="746106506" X-IronPort-AV: E=Sophos;i="5.96,175,1665471600"; d="scan'208";a="746106506" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 18 Nov 2022 11:01:01 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 4968910E; Fri, 18 Nov 2022 21:01:26 +0200 (EET) From: Andy Shevchenko <andriy.shevchenko@linux.intel.com> To: =?utf-8?b?Q2zDqW1lbnQgTMOpZ2Vy?= <clement.leger@bootlin.com>, Andy Shevchenko <andriy.shevchenko@linux.intel.com>, Sakari Ailus <sakari.ailus@linux.intel.com>, Mauro Carvalho Chehab <mchehab@kernel.org>, Hans de Goede <hdegoede@redhat.com>, linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Daniel Scally <djrscally@gmail.com>, Heikki Krogerus <heikki.krogerus@linux.intel.com>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, "Rafael J. Wysocki" <rafael@kernel.org>, Yong Zhi <yong.zhi@intel.com>, Bingbu Cao <bingbu.cao@intel.com>, Tianshu Qiu <tian.shu.qiu@intel.com> Subject: [PATCH v1 1/4] media: ipu3-cio2: Don't dereference fwnode handle Date: Fri, 18 Nov 2022 20:56:14 +0200 Message-Id: <20221118185617.33908-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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?1749861720378618031?= X-GMAIL-MSGID: =?utf-8?q?1749861720378618031?= |
Series |
[v1,1/4] media: ipu3-cio2: Don't dereference fwnode handle
|
|
Commit Message
Andy Shevchenko
Nov. 18, 2022, 6:56 p.m. UTC
Use acpi_fwnode_handle() instead of dereferencing an fwnode handle directly,
which is a better coding practice.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/media/pci/intel/ipu3/cio2-bridge.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
Comments
On Fri, Nov 18, 2022 at 08:56:14PM +0200, Andy Shevchenko wrote: > Use acpi_fwnode_handle() instead of dereferencing an fwnode handle directly, > which is a better coding practice. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/media/pci/intel/ipu3/cio2-bridge.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c > index df6c94da2f6a..18974a72e94a 100644 > --- a/drivers/media/pci/intel/ipu3/cio2-bridge.c > +++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c > @@ -263,7 +263,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, > struct cio2_bridge *bridge, > struct pci_dev *cio2) > { > - struct fwnode_handle *fwnode; > + struct fwnode_handle *fwnode, *primary; > struct cio2_sensor *sensor; > struct acpi_device *adev; > acpi_status status; > @@ -322,7 +322,9 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, > } > > sensor->adev = acpi_dev_get(adev); > - adev->fwnode.secondary = fwnode; > + > + primary = acpi_fwnode_handle(adev); > + primary->secondary = fwnode; > > cio2_bridge_instantiate_vcm_i2c_client(sensor); > This and also the others look good to me. FWIW, for the series: Acked-by: Heikki Krogerus <heikki.krogerus@linux.intel.com> thanks,
Hi Andy, sorry for the delay On 18/11/2022 18:56, Andy Shevchenko wrote: > Use acpi_fwnode_handle() instead of dereferencing an fwnode handle directly, > which is a better coding practice. > > Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com> > --- > drivers/media/pci/intel/ipu3/cio2-bridge.c | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c > index df6c94da2f6a..18974a72e94a 100644 > --- a/drivers/media/pci/intel/ipu3/cio2-bridge.c > +++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c > @@ -263,7 +263,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, > struct cio2_bridge *bridge, > struct pci_dev *cio2) > { > - struct fwnode_handle *fwnode; > + struct fwnode_handle *fwnode, *primary; > struct cio2_sensor *sensor; > struct acpi_device *adev; > acpi_status status; > @@ -322,7 +322,9 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, > } > > sensor->adev = acpi_dev_get(adev); > - adev->fwnode.secondary = fwnode; > + > + primary = acpi_fwnode_handle(adev); > + primary->secondary = fwnode; > > cio2_bridge_instantiate_vcm_i2c_client(sensor); > LGTM: Reviewed-by: Daniel Scally <dan.scally@ideasonboard.com>
diff --git a/drivers/media/pci/intel/ipu3/cio2-bridge.c b/drivers/media/pci/intel/ipu3/cio2-bridge.c index df6c94da2f6a..18974a72e94a 100644 --- a/drivers/media/pci/intel/ipu3/cio2-bridge.c +++ b/drivers/media/pci/intel/ipu3/cio2-bridge.c @@ -263,7 +263,7 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, struct cio2_bridge *bridge, struct pci_dev *cio2) { - struct fwnode_handle *fwnode; + struct fwnode_handle *fwnode, *primary; struct cio2_sensor *sensor; struct acpi_device *adev; acpi_status status; @@ -322,7 +322,9 @@ static int cio2_bridge_connect_sensor(const struct cio2_sensor_config *cfg, } sensor->adev = acpi_dev_get(adev); - adev->fwnode.secondary = fwnode; + + primary = acpi_fwnode_handle(adev); + primary->secondary = fwnode; cio2_bridge_instantiate_vcm_i2c_client(sensor);