From patchwork Sat Jul 30 15:48:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 594593 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 8E27DC04A68 for ; Sat, 30 Jul 2022 15:48:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234991AbiG3Psl (ORCPT ); Sat, 30 Jul 2022 11:48:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60848 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232125AbiG3Psk (ORCPT ); Sat, 30 Jul 2022 11:48:40 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A43915836; Sat, 30 Jul 2022 08:48:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659196119; x=1690732119; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=/lkRKIKf5NUPYe0Arklh0YQ8Fp95nZE0357TMlZXoCw=; b=D0YmyrevmNFfNisdSPANV9FT8GbkmVVhaAQYhRBBtEgRxF8ViBQM/DXk nHDrK1p6VTrp+XNjuNy8rG4MqLFuB7J3mpTqt0eDeiY6/bB7Q524oBB8F wuCLxVlVhXyJgr1nAwfCF78YccaPzoNjrHCnCuCObgtDv6ghZQJ61pARl 0vwfm9CuB/+opiX5SC14zaS64T4jCvPRZt7jagQf74HS1uTNfMrptPQhO g+v//YTuzxMKBJUAXOlp9N6a8XAoK3RXso0848uJzDQjR2RSfH0hli3KQ NH8+8YUYj8mJPXM07lnD0yymNwhUv96/d7Z+pSvNm8jf57r1RefzqMYOJ w==; X-IronPort-AV: E=McAfee;i="6400,9594,10424"; a="289695187" X-IronPort-AV: E=Sophos;i="5.93,204,1654585200"; d="scan'208";a="289695187" Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 30 Jul 2022 08:48:39 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,204,1654585200"; d="scan'208";a="660611414" Received: from black.fi.intel.com ([10.237.72.28]) by fmsmga008.fm.intel.com with ESMTP; 30 Jul 2022 08:48:36 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id E3A03F1; Sat, 30 Jul 2022 18:48:46 +0300 (EEST) From: Andy Shevchenko To: Sakari Ailus , Mauro Carvalho Chehab , linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Yong Zhi , Bingbu Cao , Dan Scally , Tianshu Qiu , Andy Shevchenko Subject: [PATCH v1 1/1] media: ipu3-cio2: Don't dereference fwnode handle Date: Sat, 30 Jul 2022 18:48:44 +0300 Message-Id: <20220730154844.89556-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-media@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 Reported-by: kernel test robot Reported-by: kernel test robot --- 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..5998541d331c 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, *current; 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; + + current = acpi_fwnode_handle(adev); + current->secondary = fwnode; cio2_bridge_instantiate_vcm_i2c_client(sensor);