Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1019929rwb; Fri, 18 Nov 2022 11:26:25 -0800 (PST) X-Google-Smtp-Source: AA0mqf7wqkS4o7YwVeO7mYocy5Qi2ycgTp7EQKNM03g2Qkgf/jvDKqDZj7hozv7h7e3XLVnRohIw X-Received: by 2002:a17:906:b17:b0:7ad:821f:a3e6 with SMTP id u23-20020a1709060b1700b007ad821fa3e6mr6921482ejg.688.1668799585186; Fri, 18 Nov 2022 11:26:25 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668799585; cv=none; d=google.com; s=arc-20160816; b=LHtCnuf182FUYPzAH3RUauH4kjkvQCjsN2UphgOI2ANgXf49JOT4ZeaBJ0HTpmVn69 oqvBzdNSKExLIvyzy4CxEBd2Q38JJ0/KJn3XNhTnXBywflQm61r2mION5qHh7fEoJTyb PJLBxeqHvt6HBYWH4PT9X+Ap7omy6KKhQLbo424GVH/bhuiUWsshIxMR6YcWOnD93V19 Whx+ozdgyZJZPC4Xm8ik2i34cRGseknpATC+dWmh70pjDZMacYkBvvMC5WBKx/apb5rO yF/q96vjPsTYZaaEwl9R0qnKpX9QDaTZ0garTs5DX5EBmb2IavEJYrys4yNTWoOITDmy TWRg== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f21-20020a0564021e9500b0045c3f6adb7csi4447728edf.215.2022.11.18.11.26.01; Fri, 18 Nov 2022 11:26:25 -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 + 90 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 ); 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 To: =?UTF-8?q?Cl=C3=A9ment=20L=C3=A9ger?= , Andy Shevchenko , Sakari Ailus , Mauro Carvalho Chehab , Hans de Goede , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: Daniel Scally , Heikki Krogerus , Greg Kroah-Hartman , "Rafael J. Wysocki" , Yong Zhi , Bingbu Cao , Tianshu Qiu 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: 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 --- 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