Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1942287rdb; Tue, 5 Sep 2023 09:23:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IERaa/vJgSlgdn/EUez88p3SgLYpGzsjsX1Ujomn8UPekgABwCbfGKfwacEgCyojrggEsC5 X-Received: by 2002:a17:907:2c6a:b0:9a5:d2f5:c76 with SMTP id ib10-20020a1709072c6a00b009a5d2f50c76mr323908ejc.5.1693931019957; Tue, 05 Sep 2023 09:23:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693931019; cv=none; d=google.com; s=arc-20160816; b=Y5X00yuhAs05mnZ85C2LVjuY/IdCBPIqs16R4HAc74uFlqfh+zMEcf+3XpKC+3Wews P7tWJDMkWk6LczVXA0rhsNbNmfQNoq5kMRKXIdeksp1eBNtgiNxvML94GNsCmO/QjDj7 OgRg4DkblqDzx34d22PpjqgKwORWqvESzaRLlqCdjlr+xSD7/Odnooq8wA4h4p522eT0 m/FrLd2AtsBZ/6ypJvXeRM80NGoKMJq+j+E1JC/Vaz6/nV4Ul938AltKVG56E4LQNkoz meYX/XZ+6iH/cxvvKufiTT/3CSx0R1G5hGk+5tUvHYxpo09waGxrYENHn4Ag4l377ZXF 9EZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=jJdDMUrX2cdHYaosf44YTB/U+q0lrXO9t2KnFSOD11s=; fh=I8/zrvfRW7rg9yyi822nupjjNdfXw6G98ght6DExHZE=; b=qYWVP7UIaOFAlXp2fxOL/dSeNexmKTwkmKvxm1IdmFLKjeAOFtxCryPyj+HzvaXvNN XMAvAGSHb2LQvK5+qEchDY9uuV9o7Is5vn+FNWlKdrwOjBnVjhxPwLBjpGhRmLnavKgv mmdzTSZbcJYW/40tibshPqEXekrmrwx1MuKHNe9FL+jDRWlRY5RFY5P/KQ8fb2Z6YqLN wYKfc+NguQA5TNuVtbSoVhD5p1oYa8YBR1F3MpuQeBxL3VIuB0vpx55XKJE0G1dzDPNI wRmgnUks5ehLN4uEG9vISch8EAbmKWdlOGxLyqDljEE8VwJzjumqZNkaTbsohxM6hCd8 p4vA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v8-20020a170906b00800b009a5f33266dfsi8033060ejy.233.2023.09.05.09.23.32; Tue, 05 Sep 2023 09:23:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=renesas.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244113AbjICQDO (ORCPT + 12 others); Sun, 3 Sep 2023 12:03:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54946 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232636AbjICQDO (ORCPT ); Sun, 3 Sep 2023 12:03:14 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 35A35100 for ; Sun, 3 Sep 2023 09:03:09 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,224,1688396400"; d="scan'208";a="178558807" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 04 Sep 2023 01:03:08 +0900 Received: from localhost.localdomain (unknown [10.226.92.30]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 2A61F4011DF1; Mon, 4 Sep 2023 01:03:05 +0900 (JST) From: Biju Das To: Saravanan Sekar Cc: Biju Das , Liam Girdwood , Mark Brown , linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH v2] regulator: mp5416: Make similar OF and ID table Date: Sun, 3 Sep 2023 17:03:01 +0100 Message-Id: <20230903160301.79111-1-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=AC_FROM_MANY_DOTS,BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Make similar OF and ID table to extend support for ID match using i2c_match_data(). Currently it works only for OF match tables as the driver_data is wrong for ID match. While at it, remove trailing comma in the terminator entry for OF/ID table and drop a space from terminator entry for ID table. Signed-off-by: Biju Das --- Note: This patch is only compile tested. v1->v2: * Removed trailing comma in the terminator entry for OF/ID table and drop a space from terminator entry for ID table. --- drivers/regulator/mp5416.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/regulator/mp5416.c b/drivers/regulator/mp5416.c index d068ac93d373..3457e650a994 100644 --- a/drivers/regulator/mp5416.c +++ b/drivers/regulator/mp5416.c @@ -200,7 +200,7 @@ static int mp5416_i2c_probe(struct i2c_client *client) return PTR_ERR(regmap); } - desc = of_device_get_match_data(dev); + desc = i2c_get_match_data(client); if (!desc) return -ENODEV; @@ -223,14 +223,14 @@ static int mp5416_i2c_probe(struct i2c_client *client) static const struct of_device_id mp5416_of_match[] = { { .compatible = "mps,mp5416", .data = &mp5416_regulators_desc }, { .compatible = "mps,mp5496", .data = &mp5496_regulators_desc }, - {}, + {} }; MODULE_DEVICE_TABLE(of, mp5416_of_match); static const struct i2c_device_id mp5416_id[] = { - { "mp5416", }, - { "mp5496", }, - { }, + { "mp5416", (kernel_ulong_t)&mp5416_regulators_desc }, + { "mp5496", (kernel_ulong_t)&mp5496_regulators_desc }, + {} }; MODULE_DEVICE_TABLE(i2c, mp5416_id); -- 2.25.1