From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (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 99599352C35 for ; Sat, 30 May 2026 20:53:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780174439; cv=none; b=piRjibwRLwJ9trPKgtfDEw/wwQCjwWUjFjv3+ozUlxh+3Z+5UU9sO+vSoSGwPPtxOl7f1rgEy1YuZjhY5rSfL889CUyb7PRGEBlhcpMyGy3HsYO39ZOV16if4+IdwvGkobMGUk/F5FV9K1uleYFR+8lnbDPfBS9Tl6LwDYx3KaI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780174439; c=relaxed/simple; bh=XpQHMDJ27AXuzTQwwfYbHHeXlvyKPjXKQUoqFRB5wHQ=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=Ng0u/znNDCUAs59YAdY4XU3IjhZxJAeBq16Zhr90WJmvomR7LQQAW1nCUNCEYVBHVLEfRAiXYiG9m1AokUmd08cC6YDefxpF6QuzNer/puv894eqW1wg5z4mqeRRtNOsRCpopaQRFVhmRN3JYaG9SagfM81kvkcigbl1Z59+4U8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=n+fI6I3Z; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="n+fI6I3Z" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1DE8D1F00899; Sat, 30 May 2026 20:53:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1780174438; bh=bzsSuYI0tTi5BZx3rVk9aQkN5xRqeQqN6Mltb8VmmSo=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=n+fI6I3Z4u0nPTNBfxKrFBxQP0EbKFBd5kpdzY0stjpfTZpCrGBxIJvlkGcYn0vs2 0q3SVuOg6zat0N8wv0kSAThknBSgwkb+gn3X5onamBKxMpulC9TeVVkzCdywSxq56G CySnkWyTPQgsU2SCDcRy0pVouj7Jeyq54aLFPPljfXB9xNB2uIMzCu6nNpQTUEC1ox DqOiZmmE0ESP1CansBiFCYL0f1sfWdkJ/3LtCMI8AEPSk12y6Nuqyt19GcnwLfn0ek ZWzBZCfFQ9+syQwGMj78xSdITSXyZfRcQSs+3Xq5Hkibhj2i+tJ6ENt2jTFs2NZ3Iv KEOblpp+f5BsA== From: srini@kernel.org To: gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org, Rosen Penev , Srinivas Kandagatla Subject: [PATCH 05/14] nvmem: nintendo-otp: Use of_device_get_match_data() Date: Sat, 30 May 2026 21:53:24 +0100 Message-ID: <20260530205333.117458-6-srini@kernel.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260530205333.117458-1-srini@kernel.org> References: <20260530205333.117458-1-srini@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Rosen Penev Use of_device_get_match_data() to retrieve the devtype data instead of open-coding the OF match lookup and dereferencing match->data. This also replaces the deprecated of_device.h include with of.h. Assisted-by: Codex:GPT-5.5 Signed-off-by: Rosen Penev Signed-off-by: Srinivas Kandagatla --- drivers/nvmem/nintendo-otp.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/nvmem/nintendo-otp.c b/drivers/nvmem/nintendo-otp.c index 355e7f1fc6d5..e45a8a3a9774 100644 --- a/drivers/nvmem/nintendo-otp.c +++ b/drivers/nvmem/nintendo-otp.c @@ -17,7 +17,7 @@ #include #include #include -#include +#include #include #define HW_OTPCMD 0 @@ -74,8 +74,7 @@ MODULE_DEVICE_TABLE(of, nintendo_otp_of_table); static int nintendo_otp_probe(struct platform_device *pdev) { struct device *dev = &pdev->dev; - const struct of_device_id *of_id = - of_match_device(nintendo_otp_of_table, dev); + const struct nintendo_otp_devtype_data *data; struct nvmem_device *nvmem; struct nintendo_otp_priv *priv; @@ -95,8 +94,8 @@ static int nintendo_otp_probe(struct platform_device *pdev) if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs); - if (of_id->data) { - const struct nintendo_otp_devtype_data *data = of_id->data; + data = of_device_get_match_data(dev); + if (data) { config.name = data->name; config.size = data->num_banks * BANK_SIZE; } -- 2.53.0