Received: by 2002:a05:7412:b101:b0:e2:908c:2ebd with SMTP id az1csp2874136rdb; Wed, 15 Nov 2023 13:11:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IFJKX2qAp7k54uk3DvowG218C7f0NT/TqW41KccMyMtVtWtkKggpW1WikdfB254ZqPLs0O2 X-Received: by 2002:a05:6a00:234b:b0:6be:4e6e:2a85 with SMTP id j11-20020a056a00234b00b006be4e6e2a85mr16064432pfj.30.1700082709341; Wed, 15 Nov 2023 13:11:49 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700082709; cv=none; d=google.com; s=arc-20160816; b=L/UWpdScU4PKkUDRG33GCHLcSH5Sk+VYic5c0ojm43vccPC3QDyduh8x2BiQkLpits P1txkk+kxajVeE+xE05IaYhaYTRhbPpskpwR+we75I4oddJHn+YQEjW7FAbCoXR99F1i ChxNl9P3CE1m8voWmfLsBqyh66g/T4AL2chHp+Fc8fgVrRqSxuW44fZ44edA6LEHa2ba gWHJLEvpO8M+uIJLKL37ET598P15FM9ojxTeSvAkD8aA4/kLQWsFoqsQrHqvEje45/Pj 3srF3DrwVJ2WoqgXz5uvb8lxEBF82mvu3Pvixch2SFc5kU8vRu1L3zWGUSv/QNmkzMBC Ih+g== 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; bh=0MNTv3m7vV3LeSZ/LXI5jnB/Ck5QlVqFhZbxK23FsCo=; fh=q4P7/H3rgKXacl4w575QtTMldaBk2Lg1LutmCffEXfw=; b=Fg7KPUvizyedKvqaFEPpLEg8kI2ESeBI9lqtmmVyK3WStpWNXi8kPvfW7NiRb93mZb YA0a7cUNo+Ndi8ISyRrQjm68Q/oPXCAGkWPwRaKVbcHZnL9dQGTf39WcSXKbQwDROv+6 jo5n6OC/YkY4CExCqoV9+Mfl/PBC1CqWwSMHKBPg3xVYSmqvy05c8ZACqwlUt6VMipq4 +g1NNHjnuaQltFXycIutEIMwIBHg1vgeAP8JNUZ9y+KGy82rdCvrBUVT9ZoLe6+H4hox PxEhWXnyqttvsMbVZADHP+zK6qgiEx7oJmvdPE8CMgQ9CcdfJPJnDKx8+YMIGzGrERvj TzOA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [2620:137:e000::3:2]) by mx.google.com with ESMTPS id j13-20020a056a00174d00b00690d25b1991si11045345pfc.41.2023.11.15.13.11.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:11:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) client-ip=2620:137:e000::3:2; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:2 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id 4A4E380407FD; Wed, 15 Nov 2023 13:11:46 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235708AbjKOVLk (ORCPT + 99 others); Wed, 15 Nov 2023 16:11:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35910 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235694AbjKOVLb (ORCPT ); Wed, 15 Nov 2023 16:11:31 -0500 Received: from mail-ot1-f52.google.com (mail-ot1-f52.google.com [209.85.210.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7AF6919AE; Wed, 15 Nov 2023 13:02:28 -0800 (PST) Received: by mail-ot1-f52.google.com with SMTP id 46e09a7af769-6ce2fc858feso44805a34.3; Wed, 15 Nov 2023 13:02:28 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1700082147; x=1700686947; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=0MNTv3m7vV3LeSZ/LXI5jnB/Ck5QlVqFhZbxK23FsCo=; b=bRH/W5y8JLuZvaUSW7XtcQirDjXk1fcUPFPKG3QcM1dl7W7VBbGccHdmMlm7+7eFCp o4Jh79NJ8OV13B/OCGN6YX0+Xbl2uV6ojSdR2ltq6pVdk5Swgs1eQRGi03wCDCIzc2S6 kfy1cVaGV1ctnU3XHkWys5nC3w0JkGtD4t260gFyT1HRvqd3EdPIKMzShFcfRSkAHxep aled+HGECG2krhPHBQkU7Hg8VmhBF6Aede8KAhcZGQo/fhZbkVut91F7H6sRwdcpQy00 jKAvaf7NDRsnnIVODpfFIp2a3gI/jTbtRJIFPDkHAF7O/kfJ1V9IzeEjcVDjsk1GJzIf HY7A== X-Gm-Message-State: AOJu0YxMf1JKKVXTN9oIiv3iaDyl5lfVjAOmXky1yVfpBKBQhyfpL/gx akwk64ePswqQiPgPIhIWw+Zabf2pzw== X-Received: by 2002:a05:6830:1e72:b0:6ce:26ba:324 with SMTP id m18-20020a0568301e7200b006ce26ba0324mr6350826otr.15.1700082147673; Wed, 15 Nov 2023 13:02:27 -0800 (PST) Received: from herring.priv (66-90-144-107.dyn.grandenetworks.net. [66.90.144.107]) by smtp.gmail.com with ESMTPSA id f5-20020a4ab005000000b0058a010374e6sm785776oon.39.2023.11.15.13.02.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:02:27 -0800 (PST) Received: (nullmailer pid 3744123 invoked by uid 1000); Wed, 15 Nov 2023 21:02:25 -0000 From: Rob Herring To: Peter Huewe , Jarkko Sakkinen , Jason Gunthorpe Cc: linux-integrity@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [RESEND PATCH] tpm: nuvoton: Use i2c_get_match_data() Date: Wed, 15 Nov 2023 15:02:15 -0600 Message-ID: <20231115210215.3743873-1-robh@kernel.org> X-Mailer: git-send-email 2.42.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Wed, 15 Nov 2023 13:11:46 -0800 (PST) Use preferred i2c_get_match_data() instead of of_match_device() to get the driver match data. With this, adjust the includes to explicitly include the correct headers. Signed-off-by: Rob Herring --- drivers/char/tpm/tpm_i2c_nuvoton.c | 15 ++++----------- 1 file changed, 4 insertions(+), 11 deletions(-) diff --git a/drivers/char/tpm/tpm_i2c_nuvoton.c b/drivers/char/tpm/tpm_i2c_nuvoton.c index d7be03c41098..5490f7e0fa43 100644 --- a/drivers/char/tpm/tpm_i2c_nuvoton.c +++ b/drivers/char/tpm/tpm_i2c_nuvoton.c @@ -19,7 +19,8 @@ #include #include #include -#include +#include +#include #include "tpm.h" /* I2C interface offsets */ @@ -524,7 +525,6 @@ static int get_vid(struct i2c_client *client, u32 *res) static int i2c_nuvoton_probe(struct i2c_client *client) { - const struct i2c_device_id *id = i2c_client_get_device_id(client); int rc; struct tpm_chip *chip; struct device *dev = &client->dev; @@ -546,15 +546,8 @@ static int i2c_nuvoton_probe(struct i2c_client *client) if (!priv) return -ENOMEM; - if (dev->of_node) { - const struct of_device_id *of_id; - - of_id = of_match_device(dev->driver->of_match_table, dev); - if (of_id && of_id->data == OF_IS_TPM2) - chip->flags |= TPM_CHIP_FLAG_TPM2; - } else - if (id->driver_data == I2C_IS_TPM2) - chip->flags |= TPM_CHIP_FLAG_TPM2; + if (i2c_get_match_data(client)) + chip->flags |= TPM_CHIP_FLAG_TPM2; init_waitqueue_head(&priv->read_queue); -- 2.42.0