Received: by 2002:a19:f614:0:0:0:0:0 with SMTP id x20csp53789lfe; Fri, 15 Apr 2022 19:08:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwc4VJhyycn+E+V1jNIsfG4pMnbypdBkAkZueklpPLXJVvnbSMHYnSDzRRh63tqLZYJRZC5 X-Received: by 2002:a17:902:7209:b0:158:c67b:3915 with SMTP id ba9-20020a170902720900b00158c67b3915mr1725953plb.67.1650074907504; Fri, 15 Apr 2022 19:08:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650074907; cv=none; d=google.com; s=arc-20160816; b=ku10GEG+oO9yQ9LP5Em1Sl8qj/B43T+Jz1J58ZbwYOO+Wa5/94L8SHArqtqz8/KT2V BGmYCDTccz7uBx2qVoSeu0uQBCaeOI7M69zWaxMTFJwaEfUkjAcHkb6FXvZOEF3sZGAw B1NawomLeDUSCghMiafEXyBoPAEeEIkSIhqeYJhn4wPImyYIIIzdfZMv+IXFZjhGD28v VvW1Xe84DjtUwDvhUqU0x7xdBAo7/LodLQyCaD02lRWP+MSOyS+aEn7iVW36nGMyjGXV HptYL9q8FM2sjtogWytQXTsA758DLg2RncK5bZsBhZnTf2Y5tjKzISm8L7Pj/kVNSC00 aVeQ== 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=C7l/ZmaXqMn7Nl3nYdPxKYV3Z2dxYIYr+MUuGUeE/jFIKzhPc3zLyqPKKY9BEGt92S Q1RYkMqyMGLN/91QOoPAm0hh7Q0i2gNmnTYUaaYKu6Wf5p1MuKSXXLSePxBglFJPrp7d uinz0SpnU0pTnqQJ4RiIWt1cSHrN8KbDNn+MnrQ8xPNc0P6fznKEre4JN+nu7EgW5wvj Sc3AZmTQlKCqkPoRYadvZGA7rAwJqvBO3Dn4U1iQAJaRnrXspb0N/U5fOKVL9tSV8uYQ NOrFlcmI4/7JCitBy/gEe9wdJyIdJ7+VSw4dPSvuOLso/qZfZZPl7DUkyIkfe8SsP646 r6kA== 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 q29-20020a63505d000000b0038285075b9csi2920601pgl.723.2022.04.15.19.08.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 19:08:27 -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 AD6CF1DF657; Fri, 15 Apr 2022 18:26:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355743AbiDOQPp (ORCPT + 99 others); Fri, 15 Apr 2022 12:15:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355741AbiDOQPn (ORCPT ); Fri, 15 Apr 2022 12:15:43 -0400 X-Greylist: delayed 2075 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 15 Apr 2022 09:13:13 PDT Received: from 17.mo561.mail-out.ovh.net (17.mo561.mail-out.ovh.net [87.98.178.58]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E15029681F for ; Fri, 15 Apr 2022 09:13:13 -0700 (PDT) Received: from player760.ha.ovh.net (unknown [10.110.208.22]) by mo561.mail-out.ovh.net (Postfix) with ESMTP id B09CB23D6E for ; Fri, 15 Apr 2022 16:06:44 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player760.ha.ovh.net (Postfix) with ESMTPSA id DDC8E2986A8E3; Fri, 15 Apr 2022 16:06:38 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-101G0046e4cf2e4-4eda-47c3-9e45-5448747ece0e, 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 v2 1/7] ASoC: ak*: use i2c_match_id and simple i2c probe Date: Fri, 15 Apr 2022 18:06:07 +0200 Message-Id: <20220415160613.148882-2-steve@sk2.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20220415160613.148882-1-steve@sk2.org> References: <20220415160613.148882-1-steve@sk2.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 10958383795147736710 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudelhedgleekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeejleelvdefieeiuddtfeevkeegueehkeekvdffgedvhedugeekgfejjeekgfeugeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrhejiedtrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh 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