From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B93E418657 for ; Wed, 15 Nov 2023 21:37:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="vAYHeNK+" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2CD8EC433C7; Wed, 15 Nov 2023 21:37:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1700084278; bh=AmCgzmB7jjz+T45RrytzAofEx2AMRRYYB6hhglefLRg=; h=Date:Cc:Subject:From:To:References:In-Reply-To:From; b=vAYHeNK+27nLlK6csqDqimKGiMbHfw6gqr5RfG1F+2FyF2QETyLVwaii0D83vzB42 PtVQOhRSWwe1LhVH7u07nXv9W8GW4TF9LiqzLCIMSpupPxvJuKJCTG7MtdFaU2w0bH CiTfFjX08v5IMmdM59s8dNC91keCn04H8Dj82yZNVDUuxAHKayzrhCkTdRQUvg7j7n pZDkQxAugC/D4TZ8O77V/MRcvxLZTPVhILsYWZlmt/YwqZsmsprA4HaMGac1GulYKs HDG6vPoCuSrsZm4gG3m7gXB7dW7Ow11Ck1iPLUoB0OYeu+WltkuYahWhTyX/EdfkBB aOiCAPDdZM6tw== Precedence: bulk X-Mailing-List: linux-integrity@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Wed, 15 Nov 2023 23:37:55 +0200 Message-Id: Cc: , Subject: Re: [RESEND PATCH] tpm: nuvoton: Use i2c_get_match_data() From: "Jarkko Sakkinen" To: "Rob Herring" , "Peter Huewe" , "Jason Gunthorpe" X-Mailer: aerc 0.15.2 References: <20231115210215.3743873-1-robh@kernel.org> In-Reply-To: <20231115210215.3743873-1-robh@kernel.org> On Wed Nov 15, 2023 at 11:02 PM EET, Rob Herring wrote: > 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_i2= c_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" > =20 > /* I2C interface offsets */ > @@ -524,7 +525,6 @@ static int get_vid(struct i2c_client *client, u32 *re= s) > =20 > static int i2c_nuvoton_probe(struct i2c_client *client) > { > - const struct i2c_device_id *id =3D i2c_client_get_device_id(client); > int rc; > struct tpm_chip *chip; > struct device *dev =3D &client->dev; > @@ -546,15 +546,8 @@ static int i2c_nuvoton_probe(struct i2c_client *clie= nt) > if (!priv) > return -ENOMEM; > =20 > - if (dev->of_node) { > - const struct of_device_id *of_id; > - > - of_id =3D of_match_device(dev->driver->of_match_table, dev); > - if (of_id && of_id->data =3D=3D OF_IS_TPM2) > - chip->flags |=3D TPM_CHIP_FLAG_TPM2; > - } else > - if (id->driver_data =3D=3D I2C_IS_TPM2) > - chip->flags |=3D TPM_CHIP_FLAG_TPM2; > + if (i2c_get_match_data(client)) > + chip->flags |=3D TPM_CHIP_FLAG_TPM2; > =20 > init_waitqueue_head(&priv->read_queue); > =20 OK, apologies for having to do a resend. I'll pick this, thanks! Reviewed-by: Jarkko Sakkinen BR, Jarkko