Received: by 2002:a05:7412:3210:b0:e2:908c:2ebd with SMTP id eu16csp797611rdb; Fri, 1 Sep 2023 04:45:04 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGY7d2nfxZr8vZUZcOuDmHB+eSBX0gFXE30Lti4SXBTnPipHIEyeMfcLqkaoaGUp/jl3QgV X-Received: by 2002:a17:906:749c:b0:993:eee4:e704 with SMTP id e28-20020a170906749c00b00993eee4e704mr2905417ejl.38.1693568704430; Fri, 01 Sep 2023 04:45:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1693568704; cv=none; d=google.com; s=arc-20160816; b=bj5NfCzpNehgIXtEx1TRJxt3iehsInVsXczXMV6Lp4MeR7B4pKnpU6+D7JT2YhuvcI qUXjHSdSH/Eddpi/xMAmvJO2p9t4FaBkZyY4OhH81kiTBS2jQO6J1dW5BRoSgBx2fKHv zhuT1C1MB2CnkWDxsoCJ3raLTtu3m/+fyUSVHvJRaav1dvKyx6a2stRtI5HCZQVtgE0g 2qY77Bo8VU8diGQUiN6NZ0XH8XbE6mkFs8rKLMVxG8RTpN5ghqmTT/SWXIF90PimKEzE b/DshZztCH7jKmaSUjVGaFs2NdiAl86VVIZecCzHywOOuS7hIKwZE41lowF9JXj2ca/0 XFdQ== 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=Pva6vbVj+q3vrDCCGgFDjWt45dCIgiwrys6PhOHWC04=; fh=LbSJW4juP395Lvyi3qpJDls+NpBKd9NSHqhyS5PL+Wc=; b=oOe//7iooyfNKX90Axl/halNr14o7a84powBaHHuP6H24aiEIEd2WGsm2bz+AIAuj9 I16ukJmE+OZLQgN7NIUqdhmqzkFRJi/RhYwYfWecuveaen4wNzOtdy6SJYec9P6A18LC npOx18VM0m/C2r4La8v2HZjQYuz3IbdkEU+6ex++tVOAiKKlBNoCa6JzuXkyIaY4UaNh Tt51iDx2zEtAzwbW2gsj0vA9OhIRy0dmFb7ochYoxfAtSs5MyPRidIqqgDTVvih5pmRd 7kqH4KkQL5AI9isV3N8P+XwWc9RxayB3+bqA6fdqh/pmt+GUyaeW7yL7yCSX9PqB8lV5 NB/A== 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 op13-20020a170906bced00b0099dfb8d5e77si2397383ejb.12.2023.09.01.04.44.55; Fri, 01 Sep 2023 04:45:04 -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 S243460AbjHaRMr (ORCPT + 31 others); Thu, 31 Aug 2023 13:12:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51214 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231409AbjHaRMq (ORCPT ); Thu, 31 Aug 2023 13:12:46 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 8A568107; Thu, 31 Aug 2023 10:12:41 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,217,1688396400"; d="scan'208";a="178331803" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie6.idc.renesas.com with ESMTP; 01 Sep 2023 02:12:40 +0900 Received: from localhost.localdomain (unknown [10.226.92.179]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id D33ED400F2AE; Fri, 1 Sep 2023 02:12:38 +0900 (JST) From: Biju Das To: Sebastian Reichel Cc: Biju Das , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Andy Shevchenko Subject: [PATCH v3] power: supply: sbs-battery: Make similar OF and ID table Date: Thu, 31 Aug 2023 18:12:35 +0100 Message-Id: <20230831171235.58477-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 field is wrong for ID match. Signed-off-by: Biju Das --- v2->v3: * Dropped unnecessary u32 casting. v1->v2: * Dropped patch#2 as Zero is a expected match value for this driver and the driver does not check for a NULL return value from *_get_match_data() anyway. --- drivers/power/supply/sbs-battery.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/sbs-battery.c b/drivers/power/supply/sbs-battery.c index cdfc8466d129..a6c204c08232 100644 --- a/drivers/power/supply/sbs-battery.c +++ b/drivers/power/supply/sbs-battery.c @@ -1135,7 +1135,7 @@ static int sbs_probe(struct i2c_client *client) if (!chip) return -ENOMEM; - chip->flags = (u32)(uintptr_t)device_get_match_data(&client->dev); + chip->flags = (uintptr_t)i2c_get_match_data(client); chip->client = client; psy_cfg.of_node = client->dev.of_node; psy_cfg.drv_data = chip; @@ -1253,9 +1253,9 @@ static SIMPLE_DEV_PM_OPS(sbs_pm_ops, sbs_suspend, NULL); #endif static const struct i2c_device_id sbs_id[] = { - { "bq20z65", 0 }, - { "bq20z75", 0 }, - { "sbs-battery", 1 }, + { "bq20z65", SBS_FLAGS_TI_BQ20ZX5 }, + { "bq20z75", SBS_FLAGS_TI_BQ20ZX5 }, + { "sbs-battery", 0 }, {} }; MODULE_DEVICE_TABLE(i2c, sbs_id); -- 2.25.1