From patchwork Mon Nov 21 15:27:01 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 23897 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1655574wrr; Mon, 21 Nov 2022 07:27:14 -0800 (PST) X-Google-Smtp-Source: AA0mqf4km1VSe7b8aBXi+Q9AIS+OUDqAvO+qnCvw9GIPpCb04gfUNHhBT9B+CeFXlm7uTyg4GBaP X-Received: by 2002:a63:4545:0:b0:460:936b:ded7 with SMTP id u5-20020a634545000000b00460936bded7mr18158915pgk.149.1669044433747; Mon, 21 Nov 2022 07:27:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669044433; cv=none; d=google.com; s=arc-20160816; b=Fj4Yh5RM6IpFbRhUxInZTIBsR0k1YrDeFu0JEL16y6JO/otMuS09uKPjVRO4GFaF2k RK94kkbPKdeWg/EnktZAF6+NZioAXanJePrmLGvp1AtcC7T4wB23TsSXNwZQxVQHtVnY 3yFkHa+e/xZoY2O9smWDAhq6rOx7syfW0fwj3KfGee9A3ZDDGqQ5m+utYI1a4RYlVsfS K5rR0OTst+uuGVCTjhbH3FFwsptVpIn1xV90fgFnqUCY+w8rw5WrP3Nhofqkkh4ntvhO uSrT6yjRQvLqRh4SzoKHxryil7LNwfrcfTyAY4WDx5DclnLyCJLWJmKcgDOgbZUz0mL1 m6BA== 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=r0aQYiUxTC4KeWoAp45skhv46gqHbOxrtltqSEjE6bo=; b=xJIzuhz7kYhw/a5Il2RkvR6/Hxv2W3Za/0/byqh5y4JPYkr00XpJyqT5wqww51V02k DzYZ7wjj6Zv3wuwkyiDsHHFkRxjREdUh6OX0TwCjzNSgqkgAY08f9jixF7SfaSYVC7a7 M7l/ZQpt44a4ausTMMsj1/sgExqbZdxTBhVSzqX5n5qnOlFxjTaPltcspaDJJX/2lq6R U1Kssx9xwivOUFInZmdTSB0z6ekCLoYAc8lp5I29hvXONVIDdgot4di/65qiz5La+gNE VB5+W+vZOPMFLDgFNqI30fAJy3wV6+bXw86f8Z1yC4pmpcnLI6yQtlk7V+lG8tfMdOeh Iu7Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=kW55BdDW; 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 e11-20020a63f54b000000b00476d24ebb09si11363041pgk.23.2022.11.21.07.27.00; Mon, 21 Nov 2022 07:27:13 -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=kW55BdDW; 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 S231366AbiKUP0q (ORCPT + 99 others); Mon, 21 Nov 2022 10:26:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56464 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229755AbiKUP0o (ORCPT ); Mon, 21 Nov 2022 10:26:44 -0500 Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BAA25138; Mon, 21 Nov 2022 07:26:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1669044403; x=1700580403; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=D9tqklG/AuJk+yfcIp6L39SLa6QZ1GCROYNdZojYkW8=; b=kW55BdDWuVhdhfGLBvOXIedYNJkiQcdovLac/ni1/VOJxGKTmsc5M7wF kww6FQ5YcnAgZbT+aSU8Tn5L7s6ngWTJiNo+d3ZpQRlka8CcdLQ17vEqU OWsqxv3DT/8pzKRAmp2k9lVWWHVjpB1iOFBP1Lj2HlHj5yPn/F14eAC1r 27XFwhxFLQAxtWmi/bLw9e5tSlgKg2wgunJ3tuQ768wvlOwnfGI9r9Pbj yeGradjlj/uEJDMrHsdnGwx9af/UBTml7uWrjSqtFYkxF4oiNeWxCTdtt WIAe6t+9hubk2iF/+L+nwtVGFchCSlNnH6MzB3lr95SYh7mqvY2fvilXY Q==; X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="399872888" X-IronPort-AV: E=Sophos;i="5.96,181,1665471600"; d="scan'208";a="399872888" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 21 Nov 2022 07:26:43 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10538"; a="746949110" X-IronPort-AV: E=Sophos;i="5.96,181,1665471600"; d="scan'208";a="746949110" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga002.fm.intel.com with ESMTP; 21 Nov 2022 07:26:39 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 2A87510E; Mon, 21 Nov 2022 17:27:05 +0200 (EET) From: Andy Shevchenko To: Heikki Krogerus , =?utf-8?b?Q2zDqW1l?= =?utf-8?b?bnQgTMOpZ2Vy?= , Andy Shevchenko , Mauro Carvalho Chehab , Daniel Scally , Sakari Ailus , Hans de Goede , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Greg Kroah-Hartman , "Rafael J. Wysocki" , Yong Zhi , Bingbu Cao , Tianshu Qiu , Daniel Scally Subject: [PATCH v2 1/4] media: ipu3-cio2: Don't dereference fwnode handle Date: Mon, 21 Nov 2022 17:27:01 +0200 Message-Id: <20221121152704.30180-1-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 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: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750119936305224233?= X-GMAIL-MSGID: =?utf-8?q?1750119936305224233?= Use acpi_fwnode_handle() instead of dereferencing an fwnode handle directly, which is a better coding practice. Signed-off-by: Andy Shevchenko Tested-by: Daniel Scally Acked-by: Heikki Krogerus Reviewed-by: Daniel Scally Acked-by: Sakari Ailus --- v2: added tags (Heikki, Daniel) 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);