Commit fec1982d authored by Heiner Kallweit's avatar Heiner Kallweit Committed by Wolfram Sang
Browse files

i2c: mux: Remove class argument from i2c_mux_add_adapter()



99a741aa7a2d ("i2c: mux: gpio: remove support for class-based device
instantiation") removed the last call to i2c_mux_add_adapter() with a
non-null class argument. Therefore the class argument can be removed.

Note: Class-based device instantiation is a legacy mechanism which
shouldn't be used in new code, so we can rule out that this argument
may be needed again in the future.

Signed-off-by: default avatarHeiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Acked-by: default avatarPeter Rosin <peda@axentia.se>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: default avatarJonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: default avatarRob Herring (Arm) <robh@kernel.org>
Signed-off-by: default avatarWolfram Sang <wsa+renesas@sang-engineering.com>
parent 0e9ee7dd
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1092,7 +1092,7 @@ static int sii902x_init(struct sii902x *sii902x)
	}

	sii902x->i2cmux->priv = sii902x;
	ret = i2c_mux_add_adapter(sii902x->i2cmux, 0, 0, 0);
	ret = i2c_mux_add_adapter(sii902x->i2cmux, 0, 0);
	if (ret)
		goto err_unreg_audio;

+1 −23
Original line number Diff line number Diff line
@@ -127,19 +127,6 @@ static u32 i2c_mux_functionality(struct i2c_adapter *adap)
	return parent->algo->functionality(parent);
}

/* Return all parent classes, merged */
static unsigned int i2c_mux_parent_classes(struct i2c_adapter *parent)
{
	unsigned int class = 0;

	do {
		class |= parent->class;
		parent = i2c_parent_is_i2c_adapter(parent);
	} while (parent);

	return class;
}

static void i2c_mux_lock_bus(struct i2c_adapter *adapter, unsigned int flags)
{
	struct i2c_mux_priv *priv = adapter->algo_data;
@@ -281,8 +268,7 @@ static const struct i2c_lock_operations i2c_parent_lock_ops = {
};

int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
			u32 force_nr, u32 chan_id,
			unsigned int class)
			u32 force_nr, u32 chan_id)
{
	struct i2c_adapter *parent = muxc->parent;
	struct i2c_mux_priv *priv;
@@ -340,14 +326,6 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
	else
		priv->adap.lock_ops = &i2c_parent_lock_ops;

	/* Sanity check on class */
	if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED)
		dev_err(&parent->dev,
			"Segment %d behind mux can't share classes with ancestors\n",
			chan_id);
	else
		priv->adap.class = class;

	/*
	 * Try to populate the mux adapter's of_node, expands to
	 * nothing if !CONFIG_OF.
+1 −1
Original line number Diff line number Diff line
@@ -167,7 +167,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev)
	}

	/* Actually add the mux adapter */
	ret = i2c_mux_add_adapter(muxc, 0, 0, 0);
	ret = i2c_mux_add_adapter(muxc, 0, 0);
	if (ret)
		i2c_put_adapter(muxc->parent);

+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
	for (i = 0; i < mux->data.n_values; i++) {
		u32 nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0;

		ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], 0);
		ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i]);
		if (ret)
			goto add_adapter_failed;
	}
+1 −1
Original line number Diff line number Diff line
@@ -124,7 +124,7 @@ static int i2c_mux_probe(struct platform_device *pdev)
			goto err_children;
		}

		ret = i2c_mux_add_adapter(muxc, 0, chan, 0);
		ret = i2c_mux_add_adapter(muxc, 0, chan);
		if (ret)
			goto err_children;
	}
Loading