From nobody Mon Feb 9 04:36:24 2026 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 9966DC83F3E for ; Sat, 2 Sep 2023 20:25:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234181AbjIBUZQ (ORCPT ); Sat, 2 Sep 2023 16:25:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35016 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231805AbjIBUZP (ORCPT ); Sat, 2 Sep 2023 16:25:15 -0400 Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 918EECC5; Sat, 2 Sep 2023 13:25:12 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,223,1688396400"; d="scan'208";a="174805738" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie5.idc.renesas.com with ESMTP; 03 Sep 2023 05:25:12 +0900 Received: from localhost.localdomain (unknown [10.226.92.16]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id 68D58407243A; Sun, 3 Sep 2023 05:25:10 +0900 (JST) From: Biju Das To: Sebastian Reichel Cc: Biju Das , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH 1/2] power: supply: bq256xx: Use i2c_get_match_data() Date: Sat, 2 Sep 2023 21:25:04 +0100 Message-Id: <20230902202505.97609-2-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230902202505.97609-1-biju.das.jz@bp.renesas.com> References: <20230902202505.97609-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Use i2c_get_match_data() for OF/ID/ACPI match instead of ID lookup by replacing OF/ACPI/ID match data from enum bq256xx_id to struct bq256xx_chip_info. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko --- drivers/power/supply/bq256xx_charger.c | 44 +++++++++++++------------- 1 file changed, 22 insertions(+), 22 deletions(-) diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/= bq256xx_charger.c index 82d3cd5ee2f9..fda4286323ee 100644 --- a/drivers/power/supply/bq256xx_charger.c +++ b/drivers/power/supply/bq256xx_charger.c @@ -1702,7 +1702,7 @@ static int bq256xx_probe(struct i2c_client *client) =20 bq->client =3D client; bq->dev =3D dev; - bq->chip_info =3D &bq256xx_chip_info_tbl[id->driver_data]; + bq->chip_info =3D i2c_get_match_data(client); =20 mutex_init(&bq->lock); =20 @@ -1771,37 +1771,37 @@ static int bq256xx_probe(struct i2c_client *client) } =20 static const struct i2c_device_id bq256xx_i2c_ids[] =3D { - { "bq25600", BQ25600 }, - { "bq25600d", BQ25600D }, - { "bq25601", BQ25601 }, - { "bq25601d", BQ25601D }, - { "bq25611d", BQ25611D }, - { "bq25618", BQ25618 }, - { "bq25619", BQ25619 }, + { "bq25600", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25600] }, + { "bq25600d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25600D] }, + { "bq25601", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25601] }, + { "bq25601d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25601D] }, + { "bq25611d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25611D] }, + { "bq25618", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25618] }, + { "bq25619", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25619] }, {}, }; MODULE_DEVICE_TABLE(i2c, bq256xx_i2c_ids); =20 static const struct of_device_id bq256xx_of_match[] =3D { - { .compatible =3D "ti,bq25600", .data =3D (void *)BQ25600 }, - { .compatible =3D "ti,bq25600d", .data =3D (void *)BQ25600D }, - { .compatible =3D "ti,bq25601", .data =3D (void *)BQ25601 }, - { .compatible =3D "ti,bq25601d", .data =3D (void *)BQ25601D }, - { .compatible =3D "ti,bq25611d", .data =3D (void *)BQ25611D }, - { .compatible =3D "ti,bq25618", .data =3D (void *)BQ25618 }, - { .compatible =3D "ti,bq25619", .data =3D (void *)BQ25619 }, + { .compatible =3D "ti,bq25600", .data =3D &bq256xx_chip_info_tbl[BQ25600]= }, + { .compatible =3D "ti,bq25600d", .data =3D &bq256xx_chip_info_tbl[BQ25600= D] }, + { .compatible =3D "ti,bq25601", .data =3D &bq256xx_chip_info_tbl[BQ25601]= }, + { .compatible =3D "ti,bq25601d", .data =3D &bq256xx_chip_info_tbl[BQ25601= D] }, + { .compatible =3D "ti,bq25611d", .data =3D &bq256xx_chip_info_tbl[BQ25611= D] }, + { .compatible =3D "ti,bq25618", .data =3D &bq256xx_chip_info_tbl[BQ25618]= }, + { .compatible =3D "ti,bq25619", .data =3D &bq256xx_chip_info_tbl[BQ25619]= }, { }, }; MODULE_DEVICE_TABLE(of, bq256xx_of_match); =20 static const struct acpi_device_id bq256xx_acpi_match[] =3D { - { "bq25600", BQ25600 }, - { "bq25600d", BQ25600D }, - { "bq25601", BQ25601 }, - { "bq25601d", BQ25601D }, - { "bq25611d", BQ25611D }, - { "bq25618", BQ25618 }, - { "bq25619", BQ25619 }, + { "bq25600", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25600] }, + { "bq25600d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25600D] }, + { "bq25601", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25601] }, + { "bq25601d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25601D] }, + { "bq25611d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25611D] }, + { "bq25618", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25618] }, + { "bq25619", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25619] }, {}, }; MODULE_DEVICE_TABLE(acpi, bq256xx_acpi_match); --=20 2.25.1 From nobody Mon Feb 9 04:36:24 2026 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 98156C71153 for ; Sat, 2 Sep 2023 20:25:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234230AbjIBUZY (ORCPT ); Sat, 2 Sep 2023 16:25:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35032 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231805AbjIBUZS (ORCPT ); Sat, 2 Sep 2023 16:25:18 -0400 Received: from relmlie6.idc.renesas.com (relmlor2.renesas.com [210.160.252.172]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7437C1A8; Sat, 2 Sep 2023 13:25:15 -0700 (PDT) X-IronPort-AV: E=Sophos;i="6.02,223,1688396400"; d="scan'208";a="178513365" Received: from unknown (HELO relmlir6.idc.renesas.com) ([10.200.68.152]) by relmlie6.idc.renesas.com with ESMTP; 03 Sep 2023 05:25:14 +0900 Received: from localhost.localdomain (unknown [10.226.92.16]) by relmlir6.idc.renesas.com (Postfix) with ESMTP id F126C4072B19; Sun, 3 Sep 2023 05:25:12 +0900 (JST) From: Biju Das To: Sebastian Reichel Cc: Biju Das , linux-pm@vger.kernel.org, linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH 2/2] power: supply: bq256xx: Some cleanups Date: Sat, 2 Sep 2023 21:25:05 +0100 Message-Id: <20230902202505.97609-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230902202505.97609-1-biju.das.jz@bp.renesas.com> References: <20230902202505.97609-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" Some cleanups: * Remove trailing comma in the terminator entry for OF/ID/ACPI table. * Drop a space from terminator entry for OF table. Signed-off-by: Biju Das Reviewed-by: Andy Shevchenko --- drivers/power/supply/bq256xx_charger.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/power/supply/bq256xx_charger.c b/drivers/power/supply/= bq256xx_charger.c index fda4286323ee..474201815a27 100644 --- a/drivers/power/supply/bq256xx_charger.c +++ b/drivers/power/supply/bq256xx_charger.c @@ -1778,7 +1778,7 @@ static const struct i2c_device_id bq256xx_i2c_ids[] = =3D { { "bq25611d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25611D] }, { "bq25618", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25618] }, { "bq25619", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25619] }, - {}, + {} }; MODULE_DEVICE_TABLE(i2c, bq256xx_i2c_ids); =20 @@ -1790,7 +1790,7 @@ static const struct of_device_id bq256xx_of_match[] = =3D { { .compatible =3D "ti,bq25611d", .data =3D &bq256xx_chip_info_tbl[BQ25611= D] }, { .compatible =3D "ti,bq25618", .data =3D &bq256xx_chip_info_tbl[BQ25618]= }, { .compatible =3D "ti,bq25619", .data =3D &bq256xx_chip_info_tbl[BQ25619]= }, - { }, + {} }; MODULE_DEVICE_TABLE(of, bq256xx_of_match); =20 @@ -1802,7 +1802,7 @@ static const struct acpi_device_id bq256xx_acpi_match= [] =3D { { "bq25611d", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25611D] }, { "bq25618", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25618] }, { "bq25619", (kernel_ulong_t)&bq256xx_chip_info_tbl[BQ25619] }, - {}, + {} }; MODULE_DEVICE_TABLE(acpi, bq256xx_acpi_match); =20 --=20 2.25.1