From patchwork Mon Aug 28 09:08:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13367714 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 733BDC83F12 for ; Mon, 28 Aug 2023 09:09:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229497AbjH1JJJ (ORCPT ); Mon, 28 Aug 2023 05:09:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45916 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229617AbjH1JIq (ORCPT ); Mon, 28 Aug 2023 05:08:46 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9C2DDEC; Mon, 28 Aug 2023 02:08:43 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,207,1688396400"; d="scan'208";a="177906192" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 28 Aug 2023 18:08:43 +0900 Received: from localhost.localdomain (unknown [10.226.92.234]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 62E2641B7376; Mon, 28 Aug 2023 18:08:40 +0900 (JST) From: Biju Das To: Alessandro Zummo , Alexandre Belloni Cc: Biju Das , linux-rtc@vger.kernel.org, Geert Uytterhoeven , Andy Shevchenko , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH] rtc: rx8581: Simplify probe() Date: Mon, 28 Aug 2023 10:08:28 +0100 Message-Id: <20230828090828.26897-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Make similar OF and ID table and simplify probe() by replacing of_device_get_match_data()->i2c_get_match_data(). Signed-off-by: Biju Das --- Note: * This patch is only compile tested. --- drivers/rtc/rtc-rx8581.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/rtc/rtc-rx8581.c b/drivers/rtc/rtc-rx8581.c index 48efd61a114d..68dd8b9b52f9 100644 --- a/drivers/rtc/rtc-rx8581.c +++ b/drivers/rtc/rtc-rx8581.c @@ -250,8 +250,7 @@ static const struct rx85x1_config rx8571_config = { static int rx8581_probe(struct i2c_client *client) { struct rx8581 *rx8581; - const struct rx85x1_config *config = &rx8581_config; - const void *data = of_device_get_match_data(&client->dev); + const struct rx85x1_config *config = i2c_get_match_data(client); static struct nvmem_config nvmem_cfg[] = { { .name = "rx85x1-", @@ -273,9 +272,6 @@ static int rx8581_probe(struct i2c_client *client) dev_dbg(&client->dev, "%s\n", __func__); - if (data) - config = data; - rx8581 = devm_kzalloc(&client->dev, sizeof(struct rx8581), GFP_KERNEL); if (!rx8581) return -ENOMEM; @@ -307,7 +303,7 @@ static int rx8581_probe(struct i2c_client *client) } static const struct i2c_device_id rx8581_id[] = { - { "rx8581", 0 }, + { "rx8581", (kernel_ulong_t)&rx8581_config }, { } }; MODULE_DEVICE_TABLE(i2c, rx8581_id);