From patchwork Sat Sep 23 17:49:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Biju Das X-Patchwork-Id: 13396863 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 alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 07E82CE7A89 for ; Sat, 23 Sep 2023 17:51:30 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher ADH-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 1DDCCDF4; Sat, 23 Sep 2023 19:50:38 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 1DDCCDF4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1695491488; bh=iHDDzrPtoSgR65AwTOW77zI3+f3JFLYNcown1LjcxWo=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-Id: List-Archive:List-Help:List-Owner:List-Post:List-Subscribe: List-Unsubscribe:From; b=qd44J+6YWvxVIshIGM5DuqkHP4dEEvwju+S6CFnNr9hxI2jqkQ9M3SyV+gaRlU9di 2/rcfwjc4FXdIltXLNQjZEMY2LYyy6Z+cdlkl6v1AxwdIenuVA7vvoYhl+DuTFy5NX ZZ1X0Z2Wra5gVEgf74f/nbraMdxyKpPZJFBxrnYg= Received: by alsa1.perex.cz (Postfix, from userid 50401) id 7A865F80568; Sat, 23 Sep 2023 19:49:48 +0200 (CEST) Received: from mailman-core.alsa-project.org (mailman-core.alsa-project.org [10.254.200.10]) by alsa1.perex.cz (Postfix) with ESMTP id 35E29F8055C; Sat, 23 Sep 2023 19:49:48 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id B5691F801F5; Sat, 23 Sep 2023 19:49:44 +0200 (CEST) Received: from relmlie5.idc.renesas.com (relmlor1.renesas.com [210.160.252.171]) by alsa1.perex.cz (Postfix) with ESMTP id B964AF80124 for ; Sat, 23 Sep 2023 19:49:40 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz B964AF80124 X-IronPort-AV: E=Sophos;i="6.03,171,1694703600"; d="scan'208";a="176997671" Received: from unknown (HELO relmlir5.idc.renesas.com) ([10.200.68.151]) by relmlie5.idc.renesas.com with ESMTP; 24 Sep 2023 02:49:40 +0900 Received: from localhost.localdomain (unknown [10.226.92.12]) by relmlir5.idc.renesas.com (Postfix) with ESMTP id 33C794005B3D; Sun, 24 Sep 2023 02:49:36 +0900 (JST) From: Biju Das To: Lee Jones Cc: Biju Das , Charles Keepax , Richard Fitzgerald , alsa-devel@alsa-project.org, patches@opensource.cirrus.com, linux-kernel@vger.kernel.org, Biju Das , Andy Shevchenko Subject: [PATCH v4 2/4] mfd: madera-i2c: Simplify obtaining I2C match data Date: Sat, 23 Sep 2023 18:49:26 +0100 Message-Id: <20230923174928.56824-3-biju.das.jz@bp.renesas.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20230923174928.56824-1-biju.das.jz@bp.renesas.com> References: <20230923174928.56824-1-biju.das.jz@bp.renesas.com> MIME-Version: 1.0 Message-ID-Hash: ZXFNKTWRB65DACHT73B4KGEC4VBFO6YN X-Message-ID-Hash: ZXFNKTWRB65DACHT73B4KGEC4VBFO6YN X-MailFrom: biju.das.jz@bp.renesas.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-alsa-devel.alsa-project.org-0; header-match-alsa-devel.alsa-project.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header X-Mailman-Version: 3.3.8 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: Simplify probe() by replacing of_device_get_match_data() and ID lookup for retrieving match data by i2c_get_match_data(). Signed-off-by: Biju Das Acked-by: Charles Keepax --- Note: This patch is only compile tested. v3->v4: * Updated commit header. v2->v3: * Used uintptr_t for enum casting. v1->v2: * Added Ack tag from Charles Keepax. * Dropped blank line before switch statement. --- drivers/mfd/madera-i2c.c | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/drivers/mfd/madera-i2c.c b/drivers/mfd/madera-i2c.c index a404ea26bc79..0986e4a99f4a 100644 --- a/drivers/mfd/madera-i2c.c +++ b/drivers/mfd/madera-i2c.c @@ -18,21 +18,14 @@ static int madera_i2c_probe(struct i2c_client *i2c) { - const struct i2c_device_id *id = i2c_client_get_device_id(i2c); struct madera *madera; const struct regmap_config *regmap_16bit_config = NULL; const struct regmap_config *regmap_32bit_config = NULL; - const void *of_data; unsigned long type; const char *name; int ret; - of_data = of_device_get_match_data(&i2c->dev); - if (of_data) - type = (unsigned long)of_data; - else - type = id->driver_data; - + type = (uintptr_t)i2c_get_match_data(i2c); switch (type) { case CS47L15: if (IS_ENABLED(CONFIG_MFD_CS47L15)) {