From patchwork Wed Dec 28 09:49:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 637891 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 4EE06C3DA7A for ; Wed, 28 Dec 2022 09:49:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232775AbiL1JtR (ORCPT ); Wed, 28 Dec 2022 04:49:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46680 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232714AbiL1JtD (ORCPT ); Wed, 28 Dec 2022 04:49:03 -0500 Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB722F01B; Wed, 28 Dec 2022 01:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1672220942; x=1703756942; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=jTREtm4c31COf+aa5sKKx8GFXjmF+LQu9JNMP099WX8=; b=HdS1jKmvXq0TvE9cgC5E33r9GFweeZB2hFYdTtlcSeCa5L302IhBEKl0 jYia6dTyhuo//WAsCBT1RERuPH98q29Hrpw9jKROha+7FaZhToR54ZK0f dM/ZubpJAePtWVNl9tSSCEc4dvvsUIDQtqClUa20HRKhSgJ936mZx9SlR KYlMZLOFb27ZQwI/xr1OM1d07URMJj3h5XBVIAEDao9gvDMpP7KGOLm0V fsJ5/3Fi4KCw+9ky02/EWW1qAto7QvPBmlRJIdB7/B9+hjkVszyaKXG19 Qp3U0+1rDF9FlFnwWPlSHFys4GBCtpToQluBUIHEJ6lfz3K6upwA7r01E A==; X-IronPort-AV: E=McAfee;i="6500,9779,10573"; a="322823324" X-IronPort-AV: E=Sophos;i="5.96,280,1665471600"; d="scan'208";a="322823324" Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 28 Dec 2022 01:49:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10573"; a="685655148" X-IronPort-AV: E=Sophos;i="5.96,280,1665471600"; d="scan'208";a="685655148" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 28 Dec 2022 01:48:58 -0800 Received: by black.fi.intel.com (Postfix, from userid 1003) id 38D25159; Wed, 28 Dec 2022 11:49:29 +0200 (EET) From: Andy Shevchenko To: Greg Kroah-Hartman , Sakari Ailus , Heikki Krogerus , Andy Shevchenko , Daniel Scally , linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, linux-media@vger.kernel.org Cc: "Rafael J. Wysocki" , Yong Zhi , Bingbu Cao , Tianshu Qiu , Mauro Carvalho Chehab , Daniel Scally Subject: [PATCH v3 1/4] media: ipu3-cio2: Don't dereference fwnode handle Date: Wed, 28 Dec 2022 11:49:19 +0200 Message-Id: <20221228094922.84119-2-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221228094922.84119-1-andriy.shevchenko@linux.intel.com> References: <20221228094922.84119-1-andriy.shevchenko@linux.intel.com> 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: Sakari Ailus Tested-by: Daniel Scally Acked-by: Heikki Krogerus Reviewed-by: Daniel Scally --- 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);