Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 90b84c05 authored by Wolfram Sang's avatar Wolfram Sang Committed by Wolfram Sang
Browse files

i2c: sh_mobile: drop needless check for of_node



After removal of platform_data support, we can simplify OF handling.
of_match_device() evaluates to NULL if !CONFIG_OF or if there is no node
pointer for that device, so we can remove the check for the node ptr.

Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarWolfram Sang <wsa@the-dreams.de>
parent d2f31c49
Loading
Loading
Loading
Loading
+7 −12
Original line number Diff line number Diff line
@@ -881,6 +881,7 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)
	struct sh_mobile_i2c_data *pd;
	struct i2c_adapter *adap;
	struct resource *res;
	const struct of_device_id *match;
	int ret;
	u32 bus_speed;

@@ -910,23 +911,17 @@ static int sh_mobile_i2c_probe(struct platform_device *dev)

	ret = of_property_read_u32(dev->dev.of_node, "clock-frequency", &bus_speed);
	pd->bus_speed = ret ? STANDARD_MODE : bus_speed;

	pd->clks_per_count = 1;

	if (dev->dev.of_node) {
		const struct of_device_id *match;

	match = of_match_device(sh_mobile_i2c_dt_ids, &dev->dev);
	if (match) {
			const struct sh_mobile_dt_config *config;
		const struct sh_mobile_dt_config *config = match->data;

			config = match->data;
		pd->clks_per_count = config->clks_per_count;

		if (config->setup)
			config->setup(pd);
	}
	}

	/* The IIC blocks on SH-Mobile ARM processors
	 * come with two new bits in ICIC.