Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp977829pxb; Fri, 15 Apr 2022 17:12:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwp+kzFJU0hoGaEfOcnf1IjG7SAqa2s4/ejCrQQIkeERun+Byc19Gkwm6YuMVBBqAfo1Xnq X-Received: by 2002:a65:400d:0:b0:39d:2213:ca72 with SMTP id f13-20020a65400d000000b0039d2213ca72mr1084048pgp.332.1650067974466; Fri, 15 Apr 2022 17:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650067974; cv=none; d=google.com; s=arc-20160816; b=e8fr8O4eRTI9n5rw3haZ3iAotGP9JrNmmBPmWMELyP3pIEI2IF7c2Vmq2/dUftQ0il K3BKJ6svVsM5gk0b0ZfCcUErdodmiRADtYd2LBWuSYahoCFUQnlY92LPraZSYQj0UqQx 5lpO88FSHJ/SN4nsxxge09H+kufrJaeUa6lL8xetSw7HaVfrsXB93eKZpg3jqDxI5yMg v/sYUoccRfFMrKGQ+0V8p1WDLam3+JXABPZtSArqD5AYi+utogNIRJxtqZ3ZLQidZnN1 XCMIV3DJ6DZBcnzRqht8utU8KS1CoUJVUBhZDn4ySmzEcyj7lUMxBECK64G844QgSqQ9 oKKQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from; bh=fua+s8C6hMkEUfc9QIxJpXPgz9gRvKzI3mTXLVqEILc=; b=0B2FEkCXBIUEFT1YBOYNfAGom4QUEE3RLgYSZWMT2PrS6FbExgzi+xDalBbo2ozr4e q+trxZQ2RSMayr0SIGTIi/zUmUvCr2qVPOwBSxHiOvks5Ln+4jOzl5NFfX92XuIis/kA yFarAXxjJ5RaXaL1yg1CKIdq5n8qMVB9ciyS5msE0p9TjX2BorxOSpEspbgOo9PqBQr/ HBrdV9KFMiNShzPKaEZOSvBz1hoOwD6Lg/IGiKv4XJMOfaN18ftHVFDRnVFYxp73Vmbl wTD/tEAMLoQuwLXZ8e/2czs6FYDhDrcqKomUh6g0MvU3rjVWLrhqdai0eQ8hPpwzOnOT ZZxw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id c22-20020a631c56000000b0039da71704a0si2849442pgm.877.2022.04.15.17.12.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:12:54 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 25CB75044C; Fri, 15 Apr 2022 17:12:46 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355666AbiDOQAq (ORCPT + 99 others); Fri, 15 Apr 2022 12:00:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237241AbiDOQAn (ORCPT ); Fri, 15 Apr 2022 12:00:43 -0400 Received: from 16.mo561.mail-out.ovh.net (16.mo561.mail-out.ovh.net [188.165.56.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7037F2656D for ; Fri, 15 Apr 2022 08:58:14 -0700 (PDT) Received: from player788.ha.ovh.net (unknown [10.111.208.192]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id 881CB216A0 for ; Fri, 15 Apr 2022 15:38:36 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player788.ha.ovh.net (Postfix) with ESMTPSA id C142829866F94; Fri, 15 Apr 2022 15:38:30 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-100R003a23bc807-e914-4507-9ce5-30e511ff9ff9, 77125C2C2681624F8512B69FC7A1C9B53E6602B4) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Liam Girdwood , Mark Brown Cc: Wolfram Sang , linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH 1/6] ASoC: ak*: use i2c_match_id and simple i2c probe Date: Fri, 15 Apr 2022 17:38:12 +0200 Message-Id: <20220415153817.141364-2-steve@sk2.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220415153817.141364-1-steve@sk2.org> References: <20220415153817.141364-1-steve@sk2.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 10483254035256542854 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudelhedgleefucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeejleelvdefieeiuddtfeevkeegueehkeekvdffgedvhedugeekgfejjeekgfeugeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejkeekrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 As part of the ongoing i2c transition to the simple probe ("probe_new"), this patch uses i2c_match_id to retrieve the driver_data for the probed device. The id parameter is thus no longer necessary and the simple probe can be used instead. Signed-off-by: Stephen Kitt --- sound/soc/codecs/ak4613.c | 10 ++++++---- sound/soc/codecs/ak4642.c | 8 +++++--- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/sound/soc/codecs/ak4613.c b/sound/soc/codecs/ak4613.c index 03b829930769..55e773f92122 100644 --- a/sound/soc/codecs/ak4613.c +++ b/sound/soc/codecs/ak4613.c @@ -876,8 +876,7 @@ static void ak4613_parse_of(struct ak4613_priv *priv, AK4613_CONFIG_SDTI_set(priv, sdti_num); } -static int ak4613_i2c_probe(struct i2c_client *i2c, - const struct i2c_device_id *id) +static int ak4613_i2c_probe(struct i2c_client *i2c) { struct device *dev = &i2c->dev; struct device_node *np = dev->of_node; @@ -888,8 +887,11 @@ static int ak4613_i2c_probe(struct i2c_client *i2c, regmap_cfg = NULL; if (np) regmap_cfg = of_device_get_match_data(dev); - else + else { + const struct i2c_device_id *id = + i2c_match_id(ak4613_i2c_id, i2c); regmap_cfg = (const struct regmap_config *)id->driver_data; + } if (!regmap_cfg) return -EINVAL; @@ -927,7 +929,7 @@ static struct i2c_driver ak4613_i2c_driver = { .name = "ak4613-codec", .of_match_table = ak4613_of_match, }, - .probe = ak4613_i2c_probe, + .probe_new = ak4613_i2c_probe, .remove = ak4613_i2c_remove, .id_table = ak4613_i2c_id, }; diff --git a/sound/soc/codecs/ak4642.c b/sound/soc/codecs/ak4642.c index c284dcc5af76..3c20ff5595eb 100644 --- a/sound/soc/codecs/ak4642.c +++ b/sound/soc/codecs/ak4642.c @@ -630,8 +630,8 @@ static struct clk *ak4642_of_parse_mcko(struct device *dev) #endif static const struct of_device_id ak4642_of_match[]; -static int ak4642_i2c_probe(struct i2c_client *i2c, - const struct i2c_device_id *id) +static const struct i2c_device_id ak4642_i2c_id[]; +static int ak4642_i2c_probe(struct i2c_client *i2c) { struct device *dev = &i2c->dev; struct device_node *np = dev->of_node; @@ -651,6 +651,8 @@ static int ak4642_i2c_probe(struct i2c_client *i2c, if (of_id) drvdata = of_id->data; } else { + const struct i2c_device_id *id = + i2c_match_id(ak4642_i2c_id, i2c); drvdata = (const struct ak4642_drvdata *)id->driver_data; } @@ -697,7 +699,7 @@ static struct i2c_driver ak4642_i2c_driver = { .name = "ak4642-codec", .of_match_table = ak4642_of_match, }, - .probe = ak4642_i2c_probe, + .probe_new = ak4642_i2c_probe, .id_table = ak4642_i2c_id, }; -- 2.27.0