Commit b7f73b6e authored by Biju Das's avatar Biju Das Committed by Alexandre Belloni
Browse files

rtc: isl1208: Simplify probe()



Simplify the probe() by replacing of_device_get_match_data() and
i2c_match_id() by i2c_get_match_data() as we have similar I2C
and DT-based matching table.

Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20230710114747.106496-1-biju.das.jz@bp.renesas.com


Signed-off-by: default avatarAlexandre Belloni <alexandre.belloni@bootlin.com>
parent 650915ec
Loading
Loading
Loading
Loading
+3 −11
Original line number Diff line number Diff line
@@ -862,17 +862,9 @@ isl1208_probe(struct i2c_client *client)
	i2c_set_clientdata(client, isl1208);

	/* Determine which chip we have */
	if (client->dev.of_node) {
		isl1208->config = of_device_get_match_data(&client->dev);
	isl1208->config = i2c_get_match_data(client);
	if (!isl1208->config)
		return -ENODEV;
	} else {
		const struct i2c_device_id *id = i2c_match_id(isl1208_id, client);

		if (!id)
			return -ENODEV;
		isl1208->config = (struct isl1208_config *)id->driver_data;
	}

	rc = isl1208_clk_present(client, "xin");
	if (rc < 0)