Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp2240278pxb; Fri, 25 Mar 2022 13:42:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx6iaJhv12qXaari0WvpALr2+YGy0ff1XVe/bU2RSDf6Fw0h+vSJRz1Jj1Nhvecc3VRGdgG X-Received: by 2002:a65:6909:0:b0:382:53c4:43c5 with SMTP id s9-20020a656909000000b0038253c443c5mr1036433pgq.502.1648240939763; Fri, 25 Mar 2022 13:42:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648240939; cv=none; d=google.com; s=arc-20160816; b=p2qS7e4jeufIYlmRJVCsXUhHnau/qPrh1XY9HrDJJFvg3lV9qsKRtmlySVYL/P9kXJ Pl4UFScuxEIGe/pqoQfic2SRbHWOWImwdU1KqjvuvpKeDYBlr7K0WLC6RmmBAIHyBhfO 3q1h5KHy27ZkEszd9W6BgtEa7bTEYj1Ac5ZoKBSPhuDoQe0HmYyC+iNvcl8Ri5s2WYz7 pweg9S+VgdSFN1c7DfRgPPtsoanfbqyKvs7Y4udNTJhWd2GdREpmqn62j8DBvYiaR/pE j9Ij1edrElQSEE7ZeJvJCNVU7gy1L/4hhg4QRRUcpnuJkbn3zl9v8pLOfktmIdcVig/v tqjA== 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=Ip/0FgTuQfdtw6v8ktyyY7zWLx4HjHItlhgVR5Mns38=; b=lNB/fDWgZM3t9CEeP4BhGnCHvEWqH03pYxUGV59oqF4U9ZP4OL+8NKryXu6bnsAbdi mE9/Wb3gpnBYRs3vWpR3MZMGPHbyLcvdEXukQ7dDfw/C/+qgqKALC2sKo/mLG7m4hkoW 2s9YIUSDXAyk5G0tLoYv+AVpFUcEaw5KXPriU64MGDdXGpF4EcgaOzo3K3iM6mlEYeN/ R3rNDhzVfVlwJN8UblT3J69Nk8fVQBJVEUCGAgN+kpkhohUOL0/bB3C/qH//+pCusraf uvGNlC7WXNpTwMz1lxcp4VthC306Dy11D36xAnrCi7k/Lu/2j6a1Dh0vAh3VU4uCNJQ5 RLkg== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id q138-20020a632a90000000b00386480237efsi3168190pgq.617.2022.03.25.13.42.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 25 Mar 2022 13:42:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 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 B10D43FD84; Fri, 25 Mar 2022 13:06:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232144AbiCYUHk (ORCPT + 99 others); Fri, 25 Mar 2022 16:07:40 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52194 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232064AbiCYUH1 (ORCPT ); Fri, 25 Mar 2022 16:07:27 -0400 Received: from 2.mo582.mail-out.ovh.net (2.mo582.mail-out.ovh.net [46.105.76.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6459A4CD55 for ; Fri, 25 Mar 2022 13:03:05 -0700 (PDT) Received: from player693.ha.ovh.net (unknown [10.110.103.132]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id E1FB024C1B for ; Fri, 25 Mar 2022 16:25:24 +0000 (UTC) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player693.ha.ovh.net (Postfix) with ESMTPSA id 4EAC428C06071; Fri, 25 Mar 2022 16:25:19 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-107S001dc4f81cd-8fd0-4ac5-9c7a-b78267933b18, 1702D5D0C6B5DF16716081994498F990499A02DA) smtp.auth=steve@sk2.org X-OVh-ClientIp: 82.65.25.201 From: Stephen Kitt To: Liam Girdwood , Mark Brown Cc: patches@opensource.cirrus.com, Wolfram Sang , linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH] ASoC: wm*: use i2c_match_id and simple i2c probe Date: Fri, 25 Mar 2022 17:25:15 +0100 Message-Id: <20220325162515.1204107-1-steve@sk2.org> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 17074272088474289798 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvvddrudehuddgkeekucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeetgedugfelkeeikeetgeegteevfeeufeetuefgudeiiedthfehtdeffeekvdeffeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmohguvgepshhmthhpohhuthdphhgvlhhopehplhgrhigvrheileefrdhhrgdrohhvhhdrnhgvthdpihhnvghtpedtrddtrddtrddtpdhmrghilhhfrhhomhepshhtvghvvgesshhkvddrohhrghdpnhgspghrtghpthhtohepuddprhgtphhtthhopehlihhnuhigqdhkvghrnhgvlhesvhhgvghrrdhkvghrnhgvlhdrohhrgh 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/wm8904.c | 9 ++++++--- sound/soc/codecs/wm8985.c | 8 +++++--- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/wm8904.c b/sound/soc/codecs/wm8904.c index a02a77fef360..04bb8e392497 100644 --- a/sound/soc/codecs/wm8904.c +++ b/sound/soc/codecs/wm8904.c @@ -2162,8 +2162,9 @@ static const struct of_device_id wm8904_of_match[] = { MODULE_DEVICE_TABLE(of, wm8904_of_match); #endif -static int wm8904_i2c_probe(struct i2c_client *i2c, - const struct i2c_device_id *id) +static const struct i2c_device_id wm8904_i2c_id[]; + +static int wm8904_i2c_probe(struct i2c_client *i2c) { struct wm8904_priv *wm8904; unsigned int val; @@ -2197,6 +2198,8 @@ static int wm8904_i2c_probe(struct i2c_client *i2c, return -EINVAL; wm8904->devtype = (enum wm8904_type)match->data; } else { + const struct i2c_device_id *id = + i2c_match_id(wm8904_i2c_id, i2c); wm8904->devtype = id->driver_data; } @@ -2328,7 +2331,7 @@ static struct i2c_driver wm8904_i2c_driver = { .name = "wm8904", .of_match_table = of_match_ptr(wm8904_of_match), }, - .probe = wm8904_i2c_probe, + .probe_new = wm8904_i2c_probe, .id_table = wm8904_i2c_id, }; diff --git a/sound/soc/codecs/wm8985.c b/sound/soc/codecs/wm8985.c index a7e01106fbc0..cf2c32eac773 100644 --- a/sound/soc/codecs/wm8985.c +++ b/sound/soc/codecs/wm8985.c @@ -1167,10 +1167,12 @@ static struct spi_driver wm8985_spi_driver = { #endif #if IS_ENABLED(CONFIG_I2C) -static int wm8985_i2c_probe(struct i2c_client *i2c, - const struct i2c_device_id *id) +static const struct i2c_device_id wm8985_i2c_id[]; + +static int wm8985_i2c_probe(struct i2c_client *i2c) { struct wm8985_priv *wm8985; + const struct i2c_device_id *id = i2c_match_id(wm8985_i2c_id, i2c); int ret; wm8985 = devm_kzalloc(&i2c->dev, sizeof *wm8985, GFP_KERNEL); @@ -1205,7 +1207,7 @@ static struct i2c_driver wm8985_i2c_driver = { .driver = { .name = "wm8985", }, - .probe = wm8985_i2c_probe, + .probe_new = wm8985_i2c_probe, .id_table = wm8985_i2c_id }; #endif -- 2.27.0