From patchwork Sun Jul 16 15:44:41 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13314837 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 8E851EB64DD for ; Sun, 16 Jul 2023 15:44:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229785AbjGPPoy (ORCPT ); Sun, 16 Jul 2023 11:44:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjGPPox (ORCPT ); Sun, 16 Jul 2023 11:44:53 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 86462E5D; Sun, 16 Jul 2023 08:44:52 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.01,210,1684767600"; d="scan'208";a="172935291" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 17 Jul 2023 00:44:52 +0900 Received: from localhost.localdomain (unknown [10.226.92.32]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 404E440062C4; Mon, 17 Jul 2023 00:44:48 +0900 (JST) From: Biju Das To: Luca Ceresoli , Michael Turquette , Stephen Boyd Cc: Biju Das , linux-clk@vger.kernel.org, Geert Uytterhoeven , Marek Vasut , Alex Helms , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH 1/2] clk: vc5: Use i2c_get_match_data() instead of device_get_match_data() Date: Sun, 16 Jul 2023 16:44:41 +0100 Message-Id: <20230716154442.93908-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230716154442.93908-1-biju.das.jz@bp.renesas.com> References: <20230716154442.93908-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org The device_get_match_data(), is to get match data for firmware interfaces such as just OF/ACPI. This driver has I2C matching table as well. Use i2c_get_match_data() to get match data for I2C, ACPI and DT-based matching. Signed-off-by: Biju Das Reviewed-by: Marek Vasut Reviewed-by: Geert Uytterhoeven --- Note: This patch is based on the work done for rtc-isl1208 and is compile tested. --- drivers/clk/clk-versaclock5.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-versaclock5.c b/drivers/clk/clk-versaclock5.c index 8bc54176f325..4197991803ba 100644 --- a/drivers/clk/clk-versaclock5.c +++ b/drivers/clk/clk-versaclock5.c @@ -956,7 +956,9 @@ static int vc5_probe(struct i2c_client *client) i2c_set_clientdata(client, vc5); vc5->client = client; - vc5->chip_info = device_get_match_data(&client->dev); + vc5->chip_info = i2c_get_match_data(client); + if (!vc5->chip_info) + return -ENODEV; vc5->pin_xin = devm_clk_get(&client->dev, "xin"); if (PTR_ERR(vc5->pin_xin) == -EPROBE_DEFER) From patchwork Sun Jul 16 15:44:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13314838 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 06D45C001DC for ; Sun, 16 Jul 2023 15:44:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230063AbjGPPo5 (ORCPT ); Sun, 16 Jul 2023 11:44:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48168 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229451AbjGPPo5 (ORCPT ); Sun, 16 Jul 2023 11:44:57 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 2B67DE5D; Sun, 16 Jul 2023 08:44:56 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.01,210,1684767600"; d="scan'208";a="172935305" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 17 Jul 2023 00:44:55 +0900 Received: from localhost.localdomain (unknown [10.226.92.32]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id CC49540061A6; Mon, 17 Jul 2023 00:44:52 +0900 (JST) From: Biju Das To: Alex Helms , Michael Turquette , Stephen Boyd Cc: Biju Das , linux-clk@vger.kernel.org, Geert Uytterhoeven , Marek Vasut , Prabhakar Mahadev Lad , linux-renesas-soc@vger.kernel.org Subject: [PATCH 2/2] clk: vc7: Use i2c_get_match_data() instead of device_get_match_data() Date: Sun, 16 Jul 2023 16:44:42 +0100 Message-Id: <20230716154442.93908-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230716154442.93908-1-biju.das.jz@bp.renesas.com> References: <20230716154442.93908-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-clk@vger.kernel.org The device_get_match_data(), is to get match data for firmware interfaces such as just OF/ACPI. This driver has I2C matching table as well. Use i2c_get_match_data() to get match data for I2C, ACPI and DT-based matching. Signed-off-by: Biju Das Reviewed-by: Marek Vasut Reviewed-by: Geert Uytterhoeven --- Note: This patch is based on the work done for rtc-isl1208 and is compile tested. --- drivers/clk/clk-versaclock7.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/clk/clk-versaclock7.c b/drivers/clk/clk-versaclock7.c index 9babb7913c1c..be91aeada81c 100644 --- a/drivers/clk/clk-versaclock7.c +++ b/drivers/clk/clk-versaclock7.c @@ -1109,7 +1109,9 @@ static int vc7_probe(struct i2c_client *client) i2c_set_clientdata(client, vc7); vc7->client = client; - vc7->chip_info = device_get_match_data(&client->dev); + vc7->chip_info = i2c_get_match_data(client); + if (!vc7->chip_info) + return -ENODEV; vc7->pin_xin = devm_clk_get(&client->dev, "xin"); if (PTR_ERR(vc7->pin_xin) == -EPROBE_DEFER) {