From patchwork Wed Nov 15 21:02:15 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rob Herring X-Patchwork-Id: 165619 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b909:0:b0:403:3b70:6f57 with SMTP id t9csp2814206vqg; Wed, 15 Nov 2023 13:11:55 -0800 (PST) X-Google-Smtp-Source: AGHT+IHpgqNmPkYaQMViyMzt7wgHbTmxWBCU44bPFlfb/JlPC08j3T6c9FjdqbPZrQfKhrrELdfw X-Received: by 2002:a05:6830:915:b0:6c4:9fda:a1e2 with SMTP id v21-20020a056830091500b006c49fdaa1e2mr8518540ott.4.1700082714933; Wed, 15 Nov 2023 13:11:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700082714; cv=none; d=google.com; s=arc-20160816; b=ShiHjlcznwgWoOQ56KrK2bMFFPajQE0GENvilmjDpXP0L17Ij6lJj2AkeT+EbVLT0s G//GoRFm5/C9DcdkGmzm1ee0UplXdEiuMAp+oQhdD7u/9u4j2cbdbeVFEsXYxkwoPW9B HcvHQOeE3h0aSgMkH9gqOBLVYd2dBz/AesYrLqnSfNOKrBSM8fZnH29JfHN6PmCzveaq rzXZE9ouYwozBrEf5WOq+V9WU6l4e0qJ0q27Lnz3eOKNFng9bru52dg3Oll/87HeenFe TwJ9awJow5nARV+lv0uQOOAO/2s6Az3SFGhS0PpqGXFpmSvnee0mg32O+g46I+I0IRYR jpBw== 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 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id bx22-20020a056a02051600b0059d48c43152si11672681pgb.40.2023.11.15.13.11.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Nov 2023 13:11:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (Postfix) with ESMTP id A6DE2805090F; Wed, 15 Nov 2023 13:11:52 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235713AbjKOVLl (ORCPT + 29 others); Wed, 15 Nov 2023 16:11:41 -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 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Wed, 15 Nov 2023 13:11:52 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1782665932889830174 X-GMAIL-MSGID: 1782665932889830174 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 Reviewed-by: Jarkko Sakkinen --- 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);