Skip to content

Commit fec1982

Browse files
hkallweitWolfram Sang
authored andcommitted
i2c: mux: Remove class argument from i2c_mux_add_adapter()
99a741a ("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: Heiner Kallweit <[email protected]> Reviewed-by: Thomas Zimmermann <[email protected]> Acked-by: Peter Rosin <[email protected]> Reviewed-by: Laurent Pinchart <[email protected]> Acked-by: Jonathan Cameron <[email protected]> Acked-by: Rob Herring (Arm) <[email protected]> Signed-off-by: Wolfram Sang <[email protected]>
1 parent 0e9ee7d commit fec1982

23 files changed

+23
-49
lines changed

drivers/gpu/drm/bridge/sii902x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ static int sii902x_init(struct sii902x *sii902x)
10921092
}
10931093

10941094
sii902x->i2cmux->priv = sii902x;
1095-
ret = i2c_mux_add_adapter(sii902x->i2cmux, 0, 0, 0);
1095+
ret = i2c_mux_add_adapter(sii902x->i2cmux, 0, 0);
10961096
if (ret)
10971097
goto err_unreg_audio;
10981098

drivers/i2c/i2c-mux.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -127,19 +127,6 @@ static u32 i2c_mux_functionality(struct i2c_adapter *adap)
127127
return parent->algo->functionality(parent);
128128
}
129129

130-
/* Return all parent classes, merged */
131-
static unsigned int i2c_mux_parent_classes(struct i2c_adapter *parent)
132-
{
133-
unsigned int class = 0;
134-
135-
do {
136-
class |= parent->class;
137-
parent = i2c_parent_is_i2c_adapter(parent);
138-
} while (parent);
139-
140-
return class;
141-
}
142-
143130
static void i2c_mux_lock_bus(struct i2c_adapter *adapter, unsigned int flags)
144131
{
145132
struct i2c_mux_priv *priv = adapter->algo_data;
@@ -281,8 +268,7 @@ static const struct i2c_lock_operations i2c_parent_lock_ops = {
281268
};
282269

283270
int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
284-
u32 force_nr, u32 chan_id,
285-
unsigned int class)
271+
u32 force_nr, u32 chan_id)
286272
{
287273
struct i2c_adapter *parent = muxc->parent;
288274
struct i2c_mux_priv *priv;
@@ -340,14 +326,6 @@ int i2c_mux_add_adapter(struct i2c_mux_core *muxc,
340326
else
341327
priv->adap.lock_ops = &i2c_parent_lock_ops;
342328

343-
/* Sanity check on class */
344-
if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED)
345-
dev_err(&parent->dev,
346-
"Segment %d behind mux can't share classes with ancestors\n",
347-
chan_id);
348-
else
349-
priv->adap.class = class;
350-
351329
/*
352330
* Try to populate the mux adapter's of_node, expands to
353331
* nothing if !CONFIG_OF.

drivers/i2c/muxes/i2c-arb-gpio-challenge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ static int i2c_arbitrator_probe(struct platform_device *pdev)
167167
}
168168

169169
/* Actually add the mux adapter */
170-
ret = i2c_mux_add_adapter(muxc, 0, 0, 0);
170+
ret = i2c_mux_add_adapter(muxc, 0, 0);
171171
if (ret)
172172
i2c_put_adapter(muxc->parent);
173173

drivers/i2c/muxes/i2c-mux-gpio.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@ static int i2c_mux_gpio_probe(struct platform_device *pdev)
207207
for (i = 0; i < mux->data.n_values; i++) {
208208
u32 nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0;
209209

210-
ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], 0);
210+
ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i]);
211211
if (ret)
212212
goto add_adapter_failed;
213213
}

drivers/i2c/muxes/i2c-mux-gpmux.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ static int i2c_mux_probe(struct platform_device *pdev)
124124
goto err_children;
125125
}
126126

127-
ret = i2c_mux_add_adapter(muxc, 0, chan, 0);
127+
ret = i2c_mux_add_adapter(muxc, 0, chan);
128128
if (ret)
129129
goto err_children;
130130
}

drivers/i2c/muxes/i2c-mux-ltc4306.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -279,7 +279,7 @@ static int ltc4306_probe(struct i2c_client *client)
279279

280280
/* Now create an adapter for each channel */
281281
for (num = 0; num < chip->nchans; num++) {
282-
ret = i2c_mux_add_adapter(muxc, 0, num, 0);
282+
ret = i2c_mux_add_adapter(muxc, 0, num);
283283
if (ret) {
284284
i2c_mux_del_adapters(muxc);
285285
return ret;

drivers/i2c/muxes/i2c-mux-mlxcpld.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ static int mlxcpld_mux_probe(struct platform_device *pdev)
154154

155155
/* Create an adapter for each channel. */
156156
for (num = 0; num < pdata->num_adaps; num++) {
157-
err = i2c_mux_add_adapter(muxc, 0, pdata->chan_ids[num], 0);
157+
err = i2c_mux_add_adapter(muxc, 0, pdata->chan_ids[num]);
158158
if (err)
159159
goto virt_reg_failed;
160160
}

drivers/i2c/muxes/i2c-mux-pca9541.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ static int pca9541_probe(struct i2c_client *client)
314314

315315
i2c_set_clientdata(client, muxc);
316316

317-
ret = i2c_mux_add_adapter(muxc, 0, 0, 0);
317+
ret = i2c_mux_add_adapter(muxc, 0, 0);
318318
if (ret)
319319
return ret;
320320

drivers/i2c/muxes/i2c-mux-pca954x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ static int pca954x_probe(struct i2c_client *client)
644644

645645
/* Now create an adapter for each channel */
646646
for (num = 0; num < data->chip->nchans; num++) {
647-
ret = i2c_mux_add_adapter(muxc, 0, num, 0);
647+
ret = i2c_mux_add_adapter(muxc, 0, num);
648648
if (ret)
649649
goto fail_cleanup;
650650
}

drivers/i2c/muxes/i2c-mux-pinctrl.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,7 +151,7 @@ static int i2c_mux_pinctrl_probe(struct platform_device *pdev)
151151

152152
/* Do not add any adapter for the idle state (if it's there at all). */
153153
for (i = 0; i < num_names - !!muxc->deselect; i++) {
154-
ret = i2c_mux_add_adapter(muxc, 0, i, 0);
154+
ret = i2c_mux_add_adapter(muxc, 0, i);
155155
if (ret)
156156
goto err_del_adapter;
157157
}

0 commit comments

Comments
 (0)