From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from fllvem-ot03.ext.ti.com (fllvem-ot03.ext.ti.com [198.47.19.245]) (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 AD77730E0CB; Thu, 14 Aug 2025 17:36:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.47.19.245 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755193020; cv=none; b=IoO1yEpgh7RXzSYk+48RL5J0UhfjAPiB618LwXC8N98Ft2W5nnepkrVhf5svCvUPZ1wfrau2lZnpz1WRkyi42sx8yzX1KV4z9O8Q//GVns17VEdGH+KRkGewmyCNfdLIK83EmZUdAktYB6TQKd0WVyzx7rspA7eOLxhje1YgFao= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1755193020; c=relaxed/simple; bh=IRCDz+BIbXIxo654FbuXhzus6ildmqDCNVHHoJFkhJY=; h=From:To:CC:Subject:Date:Message-ID:MIME-Version:Content-Type; b=TNSxnouIIdp03EtbXvYbgS3BU0L3kDkHGwWRxqyAvslmZ5fpN9VgT6Y7kicyU+4VMg1xi/RB9sqHVLo8qRLt+pri8BGjIAYKpcIyMU6t2Nd3i+bSn3SZkqCUu/v5KcLJccwkTkkmHBMbTTWVHuluG+If0qANeyeVhKvEyUGkev8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com; spf=pass smtp.mailfrom=ti.com; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b=JyqSkuEJ; arc=none smtp.client-ip=198.47.19.245 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=ti.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ti.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=ti.com header.i=@ti.com header.b="JyqSkuEJ" Received: from lelvem-sh01.itg.ti.com ([10.180.77.71]) by fllvem-ot03.ext.ti.com (8.15.2/8.15.2) with ESMTP id 57EHanek1928788; Thu, 14 Aug 2025 12:36:49 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1755193009; bh=JMIsRWBCAcp71+nhzQnKz6CzKi/vadinRct4ioI2LqE=; h=From:To:CC:Subject:Date; b=JyqSkuEJmLlAQGyVrzVqQzohnp0s98ahAq/xlhv9AASeIhBYRUl53Hh8XRrLb20uV 2BuU+aj/zhnEZE7MGsdUa/NiuKA5FSFDdhYfKl/6E7Bir03Is/DntngO7ewahZHKDC +PMRd/JEp/bfpRCqsQRt4X8DV4OEbqyG1yR0pqDc= Received: from DLEE113.ent.ti.com (dlee113.ent.ti.com [157.170.170.24]) by lelvem-sh01.itg.ti.com (8.18.1/8.18.1) with ESMTPS id 57EHamle1006284 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA256 bits=128 verify=FAIL); Thu, 14 Aug 2025 12:36:49 -0500 Received: from DLEE105.ent.ti.com (157.170.170.35) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55; Thu, 14 Aug 2025 12:36:48 -0500 Received: from lelvem-mr05.itg.ti.com (10.180.75.9) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2507.55 via Frontend Transport; Thu, 14 Aug 2025 12:36:48 -0500 Received: from lelvem-mr05.itg.ti.com ([10.249.42.149]) by lelvem-mr05.itg.ti.com (8.18.1/8.18.1) with ESMTP id 57EHamWa075711; Thu, 14 Aug 2025 12:36:48 -0500 From: Andrew Davis To: Alexandre Belloni CC: , , Andrew Davis Subject: [PATCH 1/6] rtc: abx80x: Remove use of i2c_match_id() Date: Thu, 14 Aug 2025 12:36:42 -0500 Message-ID: <20250814173647.712768-1-afd@ti.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain X-C2ProcessedOrg: 333ef613-75bf-4e12-a4b1-8e3623f5dcea The function i2c_match_id() is used to fetch the matching ID from the i2c_device_id table. This is often used to then retrieve the matching driver_data. This can be done in one step with the helper i2c_get_match_data(). This helper has a couple other benefits: * It doesn't need the i2c_device_id passed in so we do not need to have that forward declared, allowing us to remove those or move the i2c_device_id table down to its more natural spot with the other module info. * It also checks for device match data, which allows for OF and ACPI based probing. That means we do not have to manually check those first and can remove those checks. Signed-off-by: Andrew Davis --- drivers/rtc/rtc-abx80x.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/rtc/rtc-abx80x.c b/drivers/rtc/rtc-abx80x.c index 3fee27914ba80..eca09872ea971 100644 --- a/drivers/rtc/rtc-abx80x.c +++ b/drivers/rtc/rtc-abx80x.c @@ -772,8 +772,7 @@ static int abx80x_probe(struct i2c_client *client) struct abx80x_priv *priv; int i, data, err, trickle_cfg = -EINVAL; char buf[7]; - const struct i2c_device_id *id = i2c_match_id(abx80x_id, client); - unsigned int part = id->driver_data; + unsigned int part = (uintptr_t)i2c_get_match_data(client); unsigned int partnumber; unsigned int majrev, minrev; unsigned int lot; -- 2.39.2