From patchwork Wed Dec 9 23:48:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandre Belloni X-Patchwork-Id: 11962867 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E215EC4361B for ; Wed, 9 Dec 2020 23:50:56 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A855A23B51 for ; Wed, 9 Dec 2020 23:50:56 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A855A23B51 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=bootlin.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=WR9u/32rNzLwSIZr2jaHcaLuBIjgrwYVNhyE7+BQBMU=; b=Tb3zWsJLIOJ23e/Ni+IIPxuyN Ey3oKmTpc43SLk5lF303wJgUt5EPuu5SOQaVTTONmnRWc/gqdmppuY2/9u3cxx95Au3gO+kCdRnlk VeBvA3i14PrOvh7GJ9AAlziiFiCoVUOK08P1pIVP1IjzSANgF6cDltRYgYg3XWHXxW3jGdGMZOLL2 H375YsSBnzhR3nk2J0XAXSM+gcgzp4T6NHHjpN73NQc42j3tVu/Hf32eVBoawc/kze0+Ot7frrFne YG5IVF0UcqYsyBWzOILfxj2YLeYjyPdY2LnEB4uHIrCjg3Tu4+188TMR5jYANEV3cB7d5ARWTuiLZ aDV6AWP6w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn9Cu-0000NU-OL; Wed, 09 Dec 2020 23:49:16 +0000 Received: from relay1-d.mail.gandi.net ([217.70.183.193]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kn9Cm-0000Kx-OF for linux-arm-kernel@lists.infradead.org; Wed, 09 Dec 2020 23:49:10 +0000 X-Originating-IP: 86.194.74.19 Received: from localhost (lfbn-lyo-1-997-19.w86-194.abo.wanadoo.fr [86.194.74.19]) (Authenticated sender: alexandre.belloni@bootlin.com) by relay1-d.mail.gandi.net (Postfix) with ESMTPSA id 96AC5240006; Wed, 9 Dec 2020 23:49:04 +0000 (UTC) From: Alexandre Belloni To: Jonathan Cameron Subject: [PATCH 1/6] iio:pressure:ms5637: switch to probe_new Date: Thu, 10 Dec 2020 00:48:52 +0100 Message-Id: <20201209234857.1521453-2-alexandre.belloni@bootlin.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201209234857.1521453-1-alexandre.belloni@bootlin.com> References: <20201209234857.1521453-1-alexandre.belloni@bootlin.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201209_184908_922422_414EA8ED X-CRM114-Status: GOOD ( 11.88 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Alexandre Belloni , Lars-Peter Clausen , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Peter Meerwald-Stadler , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Switch to the modern i2c probe_new callback and drop the i2c_device_id array. Signed-off-by: Alexandre Belloni --- drivers/iio/pressure/ms5637.c | 25 +++++++------------------ 1 file changed, 7 insertions(+), 18 deletions(-) diff --git a/drivers/iio/pressure/ms5637.c b/drivers/iio/pressure/ms5637.c index 5b59a4137d32..7c3f0ccd917c 100644 --- a/drivers/iio/pressure/ms5637.c +++ b/drivers/iio/pressure/ms5637.c @@ -126,8 +126,7 @@ static const struct iio_info ms5637_info = { .attrs = &ms5637_attribute_group, }; -static int ms5637_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int ms5637_probe(struct i2c_client *client) { struct ms_tp_dev *dev_data; struct iio_dev *indio_dev; @@ -152,7 +151,7 @@ static int ms5637_probe(struct i2c_client *client, mutex_init(&dev_data->lock); indio_dev->info = &ms5637_info; - indio_dev->name = id->name; + indio_dev->name = device_get_match_data(&client->dev); indio_dev->modes = INDIO_DIRECT_MODE; indio_dev->channels = ms5637_channels; indio_dev->num_channels = ARRAY_SIZE(ms5637_channels); @@ -170,27 +169,17 @@ static int ms5637_probe(struct i2c_client *client, return devm_iio_device_register(&client->dev, indio_dev); } -static const struct i2c_device_id ms5637_id[] = { - {"ms5637", 0}, - {"ms5805", 0}, - {"ms5837", 0}, - {"ms8607-temppressure", 0}, - {} -}; -MODULE_DEVICE_TABLE(i2c, ms5637_id); - static const struct of_device_id ms5637_of_match[] = { - { .compatible = "meas,ms5637", }, - { .compatible = "meas,ms5805", }, - { .compatible = "meas,ms5837", }, - { .compatible = "meas,ms8607-temppressure", }, + { .compatible = "meas,ms5637", .data = "ms5637" }, + { .compatible = "meas,ms5805", .data = "ms5805" }, + { .compatible = "meas,ms5837", .data = "ms5837" }, + { .compatible = "meas,ms8607-temppressure", .data = "ms8607-temppressure" }, { }, }; MODULE_DEVICE_TABLE(of, ms5637_of_match); static struct i2c_driver ms5637_driver = { - .probe = ms5637_probe, - .id_table = ms5637_id, + .probe_new = ms5637_probe, .driver = { .name = "ms5637", .of_match_table = ms5637_of_match,