Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4454624rwb; Mon, 21 Nov 2022 07:48:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf7rhgQYoJ5wQksAc8XP8dwJVS2n9P+qyVg11DH7+6eOJDkpqk2O0KZu0DwIZ8ZgFcYqtz4W X-Received: by 2002:a17:90a:8402:b0:218:7744:5e9 with SMTP id j2-20020a17090a840200b00218774405e9mr20965165pjn.44.1669045700738; Mon, 21 Nov 2022 07:48:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669045700; cv=none; d=google.com; s=arc-20160816; b=YXlxTPRR4d/PwcfVWMvEoiDXVABlicUChElP+98MleswmEkp3wj8ZkKWKzZZJ/u+Ya qsKM3A7M2sa0eov3Wsm+DCTm0ofyP437l4C8jaGNz9TbaRiTV/jpIYn0DxjB0nvNuKof REbfBoFNSKd1FtEFJ8Z+spL/YR7CUHFqq5wmNYw/RgeZeK6ZDVL5rcNbxR085rkuhvHH QDsR/PoTZL1aOxTmucHc8moHD+OWJVURvjs+2G8rY1ag+vz/SUvYHtR3jJIVo8p6pBLW I74O00iCpg3XtWjg7CRa73uZ71Djdml0gMMiBmuzT3pRcmXKNUcbaBd3FmhnOdR5627t +yoA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d13-20020a63fd0d000000b0045af77fa685si11795791pgh.235.2022.11.21.07.48.01; Mon, 21 Nov 2022 07:48:20 -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 + 92 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?q?Cl=C3=A9ment=20L=C3=A9ger?= , 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 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: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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); -- 2.35.1