Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp984443pxb; Fri, 15 Apr 2022 17:25:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy8RmgTXha6EG8OXWhTXvVbu6GcqWf1g3yjDbF8WXkjbxFqP4Rd/2x1xqxN4td2AHgnA0nd X-Received: by 2002:a17:902:f54e:b0:158:406f:19fa with SMTP id h14-20020a170902f54e00b00158406f19famr1480201plf.42.1650068700500; Fri, 15 Apr 2022 17:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650068700; cv=none; d=google.com; s=arc-20160816; b=o9QKHgZDpaXnIALjvv/mZUWZdLWR/5K75NGJOeBXZlav3clvo+pk7z1PL7XwZcxrAb Q/QbTjY0QuQQGMQG5Dg+STQfP4dOSIhv+3fIATEqjVg7NMOLpHQAiYdsvqY+bPgFwmJa Unj9aXOQpffJwj0Gt4nqeGc8kG2h4nL6OFHoKQmGYbwc0zUy4mlvy+0ejU7AHT3HIm7U ZwPtP1A+w7R0RUj2PUVrdpG0i85+7YU+BNQ76xUja6lVx38gNMcWnT6P+9U6CuqfEHSh jHyZUzEYhghrpVZ9Cxv/P+NsOP8fs3i4jwm5qiItmJp+GRcz8BGUXJ6tKyxkjFgBMfo3 j0lQ== 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=OiyxQOHMWYCS+HyLYZ1KPEDjVVKm5hXKaXwFmMThWx0=; b=0C04+pkuuNh8PtTtRQySrZm/h0BzXhcj8C7dsY2l2pzH/swlee1GHsfEzAF6FFkwYW qZZmIMvoQMU0Ua1IA0EH/x0yv4yclLcGQwFiBRPlJRVefpdJJv1QjV8kw6vwCn4dgTuD +0hDl64NnWK18cYIXvikhSzSFOQrbuRtNoP6AWYfWCnfH9yYzg9AQuFkI2pPHFB2PrPU xxr+21yzQkJFZRjFbLEUFeep6JKkKtVIEiFmK02RjW7CeWPNrBmOEEtjQbq9J05EFHag fq4ammWYkhNhs4uJjcoB79QJy2zD5TUva5KhzbvGC7HvpZWhWhmZl+BVe1BlxZ8Hy0xA 2JQQ== 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 g21-20020a633755000000b0039d61dfad80si2756283pgn.321.2022.04.15.17.25.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Apr 2022 17:25:00 -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 54616CF4BD; Fri, 15 Apr 2022 17:23:39 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1355659AbiDOP4l (ORCPT + 99 others); Fri, 15 Apr 2022 11:56:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237241AbiDOP4k (ORCPT ); Fri, 15 Apr 2022 11:56:40 -0400 X-Greylist: delayed 599 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 15 Apr 2022 08:54:11 PDT Received: from 2.mo550.mail-out.ovh.net (2.mo550.mail-out.ovh.net [178.32.119.250]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C25A99A9A1 for ; Fri, 15 Apr 2022 08:54:11 -0700 (PDT) Received: from player788.ha.ovh.net (unknown [10.111.172.22]) by mo550.mail-out.ovh.net (Postfix) with ESMTP id 4CE16244A5 for ; Fri, 15 Apr 2022 15:38:54 +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 C468929867034; Fri, 15 Apr 2022 15:38:48 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-100R003c521644e-f40f-40d5-87c4-68faa529c824, 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 4/6] ASoC: pcm186x: use i2c_match_id and simple i2c probe Date: Fri, 15 Apr 2022 17:38:15 +0200 Message-Id: <20220415153817.141364-5-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: 10488320585173665414 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. The i2c id table is moved up before the probe function, as suggested by Wolfram Sang. Signed-off-by: Stephen Kitt --- sound/soc/codecs/pcm186x-i2c.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/sound/soc/codecs/pcm186x-i2c.c b/sound/soc/codecs/pcm186x-i2c.c index f8382b74391d..932c8d41c3ea 100644 --- a/sound/soc/codecs/pcm186x-i2c.c +++ b/sound/soc/codecs/pcm186x-i2c.c @@ -22,9 +22,18 @@ static const struct of_device_id pcm186x_of_match[] = { }; MODULE_DEVICE_TABLE(of, pcm186x_of_match); -static int pcm186x_i2c_probe(struct i2c_client *i2c, - const struct i2c_device_id *id) +static const struct i2c_device_id pcm186x_i2c_id[] = { + { "pcm1862", PCM1862 }, + { "pcm1863", PCM1863 }, + { "pcm1864", PCM1864 }, + { "pcm1865", PCM1865 }, + { } +}; +MODULE_DEVICE_TABLE(i2c, pcm186x_i2c_id); + +static int pcm186x_i2c_probe(struct i2c_client *i2c) { + const struct i2c_device_id *id = i2c_match_id(pcm186x_i2c_id, i2c); const enum pcm186x_type type = (enum pcm186x_type)id->driver_data; int irq = i2c->irq; struct regmap *regmap; @@ -36,17 +45,8 @@ static int pcm186x_i2c_probe(struct i2c_client *i2c, return pcm186x_probe(&i2c->dev, type, irq, regmap); } -static const struct i2c_device_id pcm186x_i2c_id[] = { - { "pcm1862", PCM1862 }, - { "pcm1863", PCM1863 }, - { "pcm1864", PCM1864 }, - { "pcm1865", PCM1865 }, - { } -}; -MODULE_DEVICE_TABLE(i2c, pcm186x_i2c_id); - static struct i2c_driver pcm186x_i2c_driver = { - .probe = pcm186x_i2c_probe, + .probe_new = pcm186x_i2c_probe, .id_table = pcm186x_i2c_id, .driver = { .name = "pcm186x", -- 2.27.0