From patchwork Fri Nov 18 18:56:14 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 13048643 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id F26AAC4332F for ; Fri, 18 Nov 2022 19:01:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234168AbiKRTBL (ORCPT ); Fri, 18 Nov 2022 14:01:11 -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?b?Q2zDqW1lbnQgTMOpZ2Vy?= , 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 Precedence: bulk List-ID: X-Mailing-List: linux-acpi@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 Acked-by: Heikki Krogerus --- 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);