Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp2074199imn; Mon, 1 Aug 2022 10:09:17 -0700 (PDT) X-Google-Smtp-Source: AA6agR7qDUFl93pF5BWsrP/VBB4wC4BTUYz0iswDyi6g9N3gy1AhE76TK5Ky30fhmpgRj6h3VkVq X-Received: by 2002:a17:906:8450:b0:730:6e9f:87bd with SMTP id e16-20020a170906845000b007306e9f87bdmr6156548ejy.615.1659373756848; Mon, 01 Aug 2022 10:09:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1659373756; cv=none; d=google.com; s=arc-20160816; b=F7PheJX2e8M8l5nYYEI9Gg6RuR8/Ccbds4GF1w8MH0dwKZP6zuf87LGHjLUhAGV8QI 6690k6fM5kjw1rAtw9HMtzfbY5PMA3ZRojqvKsdrRAX47h4ZRhCBvtQr3k4NoNR8OZZz 3ZqWKAqFgq9813kCBi0MqEoBeln7VshQDPboEV8a9PKE3qE7TUNQqbDcRspKITdh6pPU CVcBo0SPSPHr5hGq11FefrXTk/kN9K2zJM/Lq1BI9dlCnhVzJDKDZUXuAhtBDyBZVQxt BDbFE9cffuDRhBXeJfEyzu9Lw9fgPwwfUPWKj4vx0iiqkwARcCaXd45XxrazvAooOZLn uEsw== 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=lGSGvKy0J9qnCotIqOISldisI24c6B0oBjC80+/lsBc=; b=Noor60nMoPgKgNFsA6mDrfZd7DjhOgBmP/ST/BMHAjV40qXixgRg8HpBOnNyD27AFG sOgbMYK2trAvk9MIPaW8/J9x0zOEUdeW5U5O29XHwC6hs6j3p9SpzKQH3eomdRA2n26S /AUe+ftC+bqv3EuZZCIPJI8OyCf+YS7pmwjpzhxvrHvd3Ff9yWbo4OP01N1VqbxZoc5J 1Xl+UJZlPIi97ZbVuXLjz261txa4QJmUCfYhRcgZwO4lc0nWWRY8eO1/CeNqK+AMEvVw 2nDVEnb+kyWb36eO61KOz74YEHbkN/h5NgAGHWAyArzCeLBMJuvdbwzGttuUbewLbDn+ KBrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=e6yQzbaN; 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 x19-20020a1709064bd300b0072a4bc2162asi10246343ejv.272.2022.08.01.10.08.47; Mon, 01 Aug 2022 10:09:16 -0700 (PDT) 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=e6yQzbaN; 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 S233551AbiHAQvj (ORCPT + 99 others); Mon, 1 Aug 2022 12:51:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232389AbiHAQvh (ORCPT ); Mon, 1 Aug 2022 12:51:37 -0400 Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D83C4BF5C for ; Mon, 1 Aug 2022 09:51:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1659372696; x=1690908696; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=+4xX1yVvA2wu0xZxhzDmYNktoQ+T+Qf9rMWkxS3Rkfs=; b=e6yQzbaN+WaY5q29iVEuI+7+GYA9x8DlVtCAaHpGqm439QMMPVpAsHCS MlFhAbu5wAX+mr2UHDo9/XHJ8etBYHAXVSxwTnSHUHjj7xSEKSKs8nB9I 44JUVg7rWoTjYsp87dz4iYzxVK7oBKThSiOby1QrANar0MrhKLpwMIgp4 TpM6Xdk+ZJvUW9mbNrRlwUbiqJDtrq0rpx5LkAb+6qW/U4QnOKIaBeupl Nqse+WoVlIMmLceKMtIQLhj2rSqn4+UegibXDkqsItSBzZFc9hORsl1GN gzQjeYa9pCzfGIPzP+TjSPEZWBLdXlJjmtWZs5Z1HOAT+QTkfFtLX/yoN w==; X-IronPort-AV: E=McAfee;i="6400,9594,10426"; a="286753155" X-IronPort-AV: E=Sophos;i="5.93,208,1654585200"; d="scan'208";a="286753155" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Aug 2022 09:51:36 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,208,1654585200"; d="scan'208";a="577852276" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 01 Aug 2022 09:51:33 -0700 Received: by black.fi.intel.com (Postfix, from userid 1003) id 77907F7; Mon, 1 Aug 2022 19:51:44 +0300 (EEST) From: Andy Shevchenko To: Joerg Roedel , Jean-Philippe Brucker , virtualization@lists.linux-foundation.org, iommu@lists.linux.dev, linux-kernel@vger.kernel.org Cc: Joerg Roedel , Will Deacon , Robin Murphy , Andy Shevchenko Subject: [PATCH v1 1/1] iommu/virtio: Do not dereference fwnode in struct device Date: Mon, 1 Aug 2022 19:51:42 +0300 Message-Id: <20220801165142.20898-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=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_HI,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 In order to make the underneath API easier to change in the future, prevent users from dereferencing fwnode from struct device. Instead, use the specific device_match_fwnode() API for that. Signed-off-by: Andy Shevchenko --- drivers/iommu/virtio-iommu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iommu/virtio-iommu.c b/drivers/iommu/virtio-iommu.c index 08eeafc9529f..9fe723f55213 100644 --- a/drivers/iommu/virtio-iommu.c +++ b/drivers/iommu/virtio-iommu.c @@ -925,7 +925,7 @@ static struct virtio_driver virtio_iommu_drv; static int viommu_match_node(struct device *dev, const void *data) { - return dev->parent->fwnode == data; + return device_match_fwnode(dev->parent, data); } static struct viommu_dev *viommu_get_by_fwnode(struct fwnode_handle *fwnode) -- 2.35.1