diff mbox series

[500/606] net/mlx5: Convert to i2c's .probe_new()

Message ID 20221118224540.619276-501-uwe@kleine-koenig.org (mailing list archive)
State Not Applicable
Delegated to: Netdev Maintainers
Headers show
Series i2c: Complete conversion to i2c_probe_new | expand

Commit Message

Uwe Kleine-König Nov. 18, 2022, 10:43 p.m. UTC
From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
---
 drivers/net/ethernet/mellanox/mlxsw/i2c.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Comments

Ido Schimmel Nov. 20, 2022, 7:07 a.m. UTC | #1
In subject: s/mlx5/mlxsw/

On Fri, Nov 18, 2022 at 11:43:54PM +0100, Uwe Kleine-König wrote:
> From: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
> 
> .probe_new() doesn't get the i2c_device_id * parameter, so determine
> that explicitly in the probe function.
> 
> Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Reviewed-by: Ido Schimmel <idosch@nvidia.com>
Uwe Kleine-König Nov. 20, 2022, 8:37 p.m. UTC | #2
On Sun, Nov 20, 2022 at 09:07:41AM +0200, Ido Schimmel wrote:
> In subject: s/mlx5/mlxsw/

Hmm, I wonder how I did that, given I didn't determine the prefix by
hand. *shrug*

Thanks, I fixed that in my tree and added your Reviewed-by tag.

Best regards
Uwe
diff mbox series

Patch

diff --git a/drivers/net/ethernet/mellanox/mlxsw/i2c.c b/drivers/net/ethernet/mellanox/mlxsw/i2c.c
index f5f5f8dc3d19..2c586c2308ae 100644
--- a/drivers/net/ethernet/mellanox/mlxsw/i2c.c
+++ b/drivers/net/ethernet/mellanox/mlxsw/i2c.c
@@ -632,9 +632,9 @@  static const struct mlxsw_bus mlxsw_i2c_bus = {
 	.cmd_exec		= mlxsw_i2c_cmd_exec,
 };
 
-static int mlxsw_i2c_probe(struct i2c_client *client,
-			   const struct i2c_device_id *id)
+static int mlxsw_i2c_probe(struct i2c_client *client)
 {
+	const struct i2c_device_id *id = i2c_client_get_device_id(client);
 	const struct i2c_adapter_quirks *quirks = client->adapter->quirks;
 	struct mlxsw_i2c *mlxsw_i2c;
 	u8 status;
@@ -751,7 +751,7 @@  static void mlxsw_i2c_remove(struct i2c_client *client)
 
 int mlxsw_i2c_driver_register(struct i2c_driver *i2c_driver)
 {
-	i2c_driver->probe = mlxsw_i2c_probe;
+	i2c_driver->probe_new = mlxsw_i2c_probe;
 	i2c_driver->remove = mlxsw_i2c_remove;
 	return i2c_add_driver(i2c_driver);
 }