Received: by 2002:a05:7412:f584:b0:e2:908c:2ebd with SMTP id eh4csp1050931rdb; Mon, 4 Sep 2023 01:01:25 -0700 (PDT) X-Google-Smtp-Source: AGHT+IH/Iy0REbqRF3IBVy01kh+/13ipdC7j+7w02vEHxdYUH+OT89zy2Zwqd4uQrV665aJYjcP+ X-Received: by 2002:a17:902:a3ca:b0:1ac:8be5:8787 with SMTP id q10-20020a170902a3ca00b001ac8be58787mr6375006plb.21.1693814484640; Mon, 04 Sep 2023 01:01:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693814484; cv=none; d=google.com; s=arc-20160816; b=00fCOLWSHsUIFcei1MiadOWrdGqnGzMdX1Xm/SPta2b5uYtPI6fWdk2b3Vt5KeLf11 44ARZLpC9KzoutCkCf9uGV1deNX9Eki9bE4JHCHCioQFX6zJxo3dE3xJMy+/XLUvgaPM hsXC+bJPjEH5a0kROl4gzC7NLbAQCwbhmrNiJqAS5Ecfu6frV8pMe/8+2Ipkp7Drs8sp Tw0aU2Al8LB96ycnyxAcMGvwmRaRoFyRQi6wIUond40ieiQMF7kgozmrj5P1V8DY6eav o1zL+RSlFok5cguVBN/VDJH3SG15Vdo6WFEYrCPMfCluF07S50NiwPuRSynFMPP2mQZE PGug== 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=zwBY4WujnkRjaUVTHqX0V9BX836BD17mOSRK/cRF9m8=; fh=NVjdMTJP2anJSruYgwClNWTLOkAYA5MmJyXXqUuhOzg=; b=xF4RuAsbPeyoV1XsphJL3ojJjjQeQYwnMw9uLUMVdhbxMOWkGx9rstzeTngtDmxUBA qTzdEc1UVqtux0+ejAIg24nHJ2IXUKRkxNHuTGX9uMhIvQvlm+Yg50ABCP/vzQoLApBM 9Sr1jawLFTypAm2G1PnrydKbat2jNMynOYSR2mx7Qi5Xj5+ZM9F4wIgIozFRb3hwDvoX cxtGfXnXhTHPEQmTOQ0n1oDYqEwlpsLF1PyYdZrunStHmdZ46hcmdLUC/Srz6tCp4TZH FIEvfKQb6pxt4wHiyxnJZ4I7QywbUYDQh9RbDHyOMOyoOmmX/iC0b0rsdD+BUTdE1xX5 5I2w== 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 z16-20020a170903019000b001c1f373ea12si7596221plg.337.2023.09.04.01.01.01; Mon, 04 Sep 2023 01:01:24 -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 S243709AbjICPvf (ORCPT + 99 others); Sun, 3 Sep 2023 11:51:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229970AbjICPve (ORCPT ); Sun, 3 Sep 2023 11:51:34 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 1F656E3 for ; Sun, 3 Sep 2023 08:51:31 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,224,1688396400"; d="scan'208";a="174850742" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 04 Sep 2023 00:51:30 +0900 Received: from localhost.localdomain (unknown [10.226.92.30]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 6A95B400EA6A; Mon, 4 Sep 2023 00:51:28 +0900 (JST) From: Biju Das To: Liam Girdwood , Mark Brown Cc: Biju Das , linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH v2] regulator: mp886x: Make similar OF and ID table Date: Sun, 3 Sep 2023 16:51:25 +0100 Message-Id: <20230903155125.73638-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, 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 ID table. Signed-off-by: Biju Das --- Note: This patch is only compile tested. v1->v2: * Removed trailing comma in the terminator entry for ID table. --- drivers/regulator/mp886x.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/regulator/mp886x.c b/drivers/regulator/mp886x.c index 9911be2e6bac..a62ae5444ad8 100644 --- a/drivers/regulator/mp886x.c +++ b/drivers/regulator/mp886x.c @@ -315,7 +315,7 @@ static int mp886x_i2c_probe(struct i2c_client *client) if (IS_ERR(di->en_gpio)) return PTR_ERR(di->en_gpio); - di->ci = of_device_get_match_data(dev); + di->ci = i2c_get_match_data(client); di->dev = dev; regmap = devm_regmap_init_i2c(client, &mp886x_regmap_config); @@ -341,21 +341,15 @@ static int mp886x_i2c_probe(struct i2c_client *client) } static const struct of_device_id mp886x_dt_ids[] = { - { - .compatible = "mps,mp8867", - .data = &mp8867_ci - }, - { - .compatible = "mps,mp8869", - .data = &mp8869_ci - }, + { .compatible = "mps,mp8867", .data = &mp8867_ci }, + { .compatible = "mps,mp8869", .data = &mp8869_ci }, { } }; MODULE_DEVICE_TABLE(of, mp886x_dt_ids); static const struct i2c_device_id mp886x_id[] = { - { "mp886x", }, - { }, + { "mp886x", (kernel_ulong_t)&mp8869_ci }, + { } }; MODULE_DEVICE_TABLE(i2c, mp886x_id); -- 2.25.1