Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp366049pxa; Fri, 21 Aug 2020 09:12:56 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwADHzGUFDgyouBFqpk7Q5AWD0c0VyEncz6DTCaFuipeCsL+nxk81iWnlzaq+0qwjfukk2y X-Received: by 2002:aa7:d286:: with SMTP id w6mr3528075edq.221.1598026376630; Fri, 21 Aug 2020 09:12:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1598026376; cv=none; d=google.com; s=arc-20160816; b=rptnnt48jn5FA3iMva+iEVoSktJReUCaKSO/knyOz0EYvQCXAWAttyj9sEhByUa+Ew NVhogUbUL9Sm4D1AsUiQEEKQrCFjekRKFecCQaDzwWY4rgw2eewGqHwR/J3D6Wr097KQ xy4baMh/bRZvYLRIW1vhMG4klOzFQZdi5zgGA6kfn9DCAKEmfKKTULOugxMRapDKsxAv 6IWIBhJuV2/vXN4+jp7/czY0rmKrBQ+X/29HIA2oxS64EuWXZgqy8GUXk9siAPn/HbBX jpGxHAbzBmCHO4dgpPQNlccVx4nUDzbQ0/3Spyj54bhpmAoejrM1NsUATOrDPtXEqZRY tILQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=uELYmrPMOOjKO1bPr9WP/e568lXXuFK8giwF503EuJI=; b=ELeBGi0eXDzL+4uCId2cDX5TLzmMTYtAOlQJdC7BZG9IQxedehJGEhzXNlTugfCSd3 V47R5sjD1A/84XeyYCdWB4DzEB/cWVxOhoMU/rcGMfA3Ofe6bvubjZwTTqn8gRjZyqgQ q1U9laDFsMWIhOWLB0fkObz8MReX6DqZ5gs5XDwFIg7IT/ZNGZKv15/Y+CaNETGmISNC ekckR69xIKG1/vCjQ6KbLy2KzQn+lVJbb0dEoLrZb+4c0O5luupQAEi20wMVs3AkWaeF oAgn5Yj8pa2m/mxJAJ8B6L3Xln+Hcfv7TkLSSU67KwAEEz03/Tc315c+1J/72m1Bok5k UzhQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f9si1643297edm.167.2020.08.21.09.12.32; Fri, 21 Aug 2020 09:12:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726181AbgHUQMD (ORCPT + 99 others); Fri, 21 Aug 2020 12:12:03 -0400 Received: from 6.mo2.mail-out.ovh.net ([87.98.165.38]:43346 "EHLO 6.mo2.mail-out.ovh.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725828AbgHUQMB (ORCPT ); Fri, 21 Aug 2020 12:12:01 -0400 Received: from player755.ha.ovh.net (unknown [10.110.115.223]) by mo2.mail-out.ovh.net (Postfix) with ESMTP id DEFA21E379F for ; Fri, 21 Aug 2020 18:02:40 +0200 (CEST) Received: from sk2.org (82-65-25-201.subs.proxad.net [82.65.25.201]) (Authenticated sender: steve@sk2.org) by player755.ha.ovh.net (Postfix) with ESMTPSA id 4F52A157ED5B3; Fri, 21 Aug 2020 16:02:35 +0000 (UTC) Authentication-Results: garm.ovh; auth=pass (GARM-105G006368e313c-e325-44bd-9ae6-001aee886a17, 20EB7F6BE0168D07063FB82D5C23839419BBC220) smtp.auth=steve@sk2.org From: Stephen Kitt To: Eric Tremblay , Jean Delvare , Guenter Roeck , linux-hwmon@vger.kernel.org Cc: linux-kernel@vger.kernel.org, Stephen Kitt Subject: [PATCH] hwmon: (tmp513) use simple i2c probe Date: Fri, 21 Aug 2020 18:02:31 +0200 Message-Id: <20200821160231.592571-1-steve@sk2.org> X-Mailer: git-send-email 2.25.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 17302829769863875927 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: -100 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgeduiedrudduvddgkeejucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefuthgvphhhvghnucfmihhtthcuoehsthgvvhgvsehskhdvrdhorhhgqeenucggtffrrghtthgvrhhnpeetgedugfelkeeikeetgeegteevfeeufeetuefgudeiiedthfehtdeffeekvdeffeenucfkpheptddrtddrtddrtddpkedvrdeihedrvdehrddvtddunecuvehluhhsthgvrhfuihiivgepudenucfrrghrrghmpehmohguvgepshhmthhpqdhouhhtpdhhvghlohepphhlrgihvghrjeehhedrhhgrrdhovhhhrdhnvghtpdhinhgvtheptddrtddrtddrtddpmhgrihhlfhhrohhmpehsthgvvhgvsehskhdvrdhorhhgpdhrtghpthhtoheplhhinhhugidqkhgvrhhnvghlsehvghgvrhdrkhgvrhhnvghlrdhorhhg Sender: linux-kernel-owner@vger.kernel.org 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 --- drivers/hwmon/tmp513.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/hwmon/tmp513.c b/drivers/hwmon/tmp513.c index df66e0bc1253..9f5885b0eb74 100644 --- a/drivers/hwmon/tmp513.c +++ b/drivers/hwmon/tmp513.c @@ -709,8 +709,7 @@ static int tmp51x_configure(struct device *dev, struct tmp51x_data *data) return 0; } -static int tmp51x_probe(struct i2c_client *client, - const struct i2c_device_id *id) +static int tmp51x_probe(struct i2c_client *client) { struct device *dev = &client->dev; struct tmp51x_data *data; @@ -724,7 +723,7 @@ static int tmp51x_probe(struct i2c_client *client, if (client->dev.of_node) data->id = (enum tmp51x_ids)device_get_match_data(&client->dev); else - data->id = id->driver_data; + data->id = i2c_match_id(tmp51x_id, client)->driver_data; ret = tmp51x_configure(dev, data); if (ret < 0) { @@ -751,7 +750,7 @@ static int tmp51x_probe(struct i2c_client *client, if (IS_ERR(hwmon_dev)) return PTR_ERR(hwmon_dev); - dev_dbg(dev, "power monitor %s\n", id->name); + dev_dbg(dev, "power monitor %s\n", client->name); return 0; } @@ -761,7 +760,7 @@ static struct i2c_driver tmp51x_driver = { .name = "tmp51x", .of_match_table = of_match_ptr(tmp51x_of_match), }, - .probe = tmp51x_probe, + .probe_new = tmp51x_probe, .id_table = tmp51x_id, }; -- 2.25.4