Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Heiner Kallweit <hkallweit1@gmail.com>
Reviewed-by: Thomas Zimmermann <tzimmermann@suse.de>
Acked-by: Peter Rosin <peda@axentia.se>
Reviewed-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Acked-by: Rob Herring (Arm) <robh@kernel.org>
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

authored by

Heiner Kallweit and committed by
Wolfram Sang
fec1982d 0e9ee7dd

+23 -49
+1 -1
drivers/gpu/drm/bridge/sii902x.c
··· 1092 1092 } 1093 1093 1094 1094 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); 1096 1096 if (ret) 1097 1097 goto err_unreg_audio; 1098 1098
+1 -23
drivers/i2c/i2c-mux.c
··· 127 127 return parent->algo->functionality(parent); 128 128 } 129 129 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 - 143 130 static void i2c_mux_lock_bus(struct i2c_adapter *adapter, unsigned int flags) 144 131 { 145 132 struct i2c_mux_priv *priv = adapter->algo_data; ··· 268 281 }; 269 282 270 283 int i2c_mux_add_adapter(struct i2c_mux_core *muxc, 271 - u32 force_nr, u32 chan_id, 272 - unsigned int class) 284 + u32 force_nr, u32 chan_id) 273 285 { 274 286 struct i2c_adapter *parent = muxc->parent; 275 287 struct i2c_mux_priv *priv; ··· 325 339 priv->adap.lock_ops = &i2c_mux_lock_ops; 326 340 else 327 341 priv->adap.lock_ops = &i2c_parent_lock_ops; 328 - 329 - /* Sanity check on class */ 330 - if (i2c_mux_parent_classes(parent) & class & ~I2C_CLASS_DEPRECATED) 331 - dev_err(&parent->dev, 332 - "Segment %d behind mux can't share classes with ancestors\n", 333 - chan_id); 334 - else 335 - priv->adap.class = class; 336 342 337 343 /* 338 344 * Try to populate the mux adapter's of_node, expands to
+1 -1
drivers/i2c/muxes/i2c-arb-gpio-challenge.c
··· 167 167 } 168 168 169 169 /* Actually add the mux adapter */ 170 - ret = i2c_mux_add_adapter(muxc, 0, 0, 0); 170 + ret = i2c_mux_add_adapter(muxc, 0, 0); 171 171 if (ret) 172 172 i2c_put_adapter(muxc->parent); 173 173
+1 -1
drivers/i2c/muxes/i2c-mux-gpio.c
··· 207 207 for (i = 0; i < mux->data.n_values; i++) { 208 208 u32 nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0; 209 209 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]); 211 211 if (ret) 212 212 goto add_adapter_failed; 213 213 }
+1 -1
drivers/i2c/muxes/i2c-mux-gpmux.c
··· 124 124 goto err_children; 125 125 } 126 126 127 - ret = i2c_mux_add_adapter(muxc, 0, chan, 0); 127 + ret = i2c_mux_add_adapter(muxc, 0, chan); 128 128 if (ret) 129 129 goto err_children; 130 130 }
+1 -1
drivers/i2c/muxes/i2c-mux-ltc4306.c
··· 279 279 280 280 /* Now create an adapter for each channel */ 281 281 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); 283 283 if (ret) { 284 284 i2c_mux_del_adapters(muxc); 285 285 return ret;
+1 -1
drivers/i2c/muxes/i2c-mux-mlxcpld.c
··· 154 154 155 155 /* Create an adapter for each channel. */ 156 156 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]); 158 158 if (err) 159 159 goto virt_reg_failed; 160 160 }
+1 -1
drivers/i2c/muxes/i2c-mux-pca9541.c
··· 314 314 315 315 i2c_set_clientdata(client, muxc); 316 316 317 - ret = i2c_mux_add_adapter(muxc, 0, 0, 0); 317 + ret = i2c_mux_add_adapter(muxc, 0, 0); 318 318 if (ret) 319 319 return ret; 320 320
+1 -1
drivers/i2c/muxes/i2c-mux-pca954x.c
··· 644 644 645 645 /* Now create an adapter for each channel */ 646 646 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); 648 648 if (ret) 649 649 goto fail_cleanup; 650 650 }
+1 -1
drivers/i2c/muxes/i2c-mux-pinctrl.c
··· 151 151 152 152 /* Do not add any adapter for the idle state (if it's there at all). */ 153 153 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); 155 155 if (ret) 156 156 goto err_del_adapter; 157 157 }
+1 -1
drivers/i2c/muxes/i2c-mux-reg.c
··· 213 213 for (i = 0; i < mux->data.n_values; i++) { 214 214 nr = mux->data.base_nr ? (mux->data.base_nr + i) : 0; 215 215 216 - ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i], 0); 216 + ret = i2c_mux_add_adapter(muxc, nr, mux->data.values[i]); 217 217 if (ret) 218 218 goto err_del_mux_adapters; 219 219 }
+1 -1
drivers/iio/gyro/mpu3050-i2c.c
··· 72 72 else { 73 73 mpu3050->i2cmux->priv = mpu3050; 74 74 /* Ignore failure, not critical */ 75 - i2c_mux_add_adapter(mpu3050->i2cmux, 0, 0, 0); 75 + i2c_mux_add_adapter(mpu3050->i2cmux, 0, 0); 76 76 } 77 77 78 78 return 0;
+1 -1
drivers/iio/imu/inv_mpu6050/inv_mpu_i2c.c
··· 142 142 if (!st->muxc) 143 143 return -ENOMEM; 144 144 st->muxc->priv = dev_get_drvdata(&client->dev); 145 - result = i2c_mux_add_adapter(st->muxc, 0, 0, 0); 145 + result = i2c_mux_add_adapter(st->muxc, 0, 0); 146 146 if (result) 147 147 return result; 148 148 result = inv_mpu_acpi_create_mux_client(client);
+1 -1
drivers/media/dvb-frontends/af9013.c
··· 1480 1480 goto err_regmap_exit; 1481 1481 } 1482 1482 state->muxc->priv = state; 1483 - ret = i2c_mux_add_adapter(state->muxc, 0, 0, 0); 1483 + ret = i2c_mux_add_adapter(state->muxc, 0, 0); 1484 1484 if (ret) 1485 1485 goto err_regmap_exit; 1486 1486
+1 -1
drivers/media/dvb-frontends/lgdt3306a.c
··· 2203 2203 goto err_kfree; 2204 2204 } 2205 2205 state->muxc->priv = client; 2206 - ret = i2c_mux_add_adapter(state->muxc, 0, 0, 0); 2206 + ret = i2c_mux_add_adapter(state->muxc, 0, 0); 2207 2207 if (ret) 2208 2208 goto err_kfree; 2209 2209
+1 -1
drivers/media/dvb-frontends/m88ds3103.c
··· 1866 1866 goto err_kfree; 1867 1867 } 1868 1868 dev->muxc->priv = dev; 1869 - ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); 1869 + ret = i2c_mux_add_adapter(dev->muxc, 0, 0); 1870 1870 if (ret) 1871 1871 goto err_kfree; 1872 1872
+1 -1
drivers/media/dvb-frontends/rtl2830.c
··· 838 838 goto err_regmap_exit; 839 839 } 840 840 dev->muxc->priv = client; 841 - ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); 841 + ret = i2c_mux_add_adapter(dev->muxc, 0, 0); 842 842 if (ret) 843 843 goto err_regmap_exit; 844 844
+1 -1
drivers/media/dvb-frontends/rtl2832.c
··· 1082 1082 goto err_regmap_exit; 1083 1083 } 1084 1084 dev->muxc->priv = dev; 1085 - ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); 1085 + ret = i2c_mux_add_adapter(dev->muxc, 0, 0); 1086 1086 if (ret) 1087 1087 goto err_regmap_exit; 1088 1088
+1 -1
drivers/media/dvb-frontends/si2168.c
··· 744 744 goto err_kfree; 745 745 } 746 746 dev->muxc->priv = client; 747 - ret = i2c_mux_add_adapter(dev->muxc, 0, 0, 0); 747 + ret = i2c_mux_add_adapter(dev->muxc, 0, 0); 748 748 if (ret) 749 749 goto err_kfree; 750 750
+1 -1
drivers/media/i2c/max9286.c
··· 383 383 for_each_source(priv, source) { 384 384 unsigned int index = to_index(priv, source); 385 385 386 - ret = i2c_mux_add_adapter(priv->mux, 0, index, 0); 386 + ret = i2c_mux_add_adapter(priv->mux, 0, index); 387 387 if (ret < 0) 388 388 goto error; 389 389 }
+1 -4
drivers/media/usb/cx231xx/cx231xx-i2c.c
··· 567 567 568 568 int cx231xx_i2c_mux_register(struct cx231xx *dev, int mux_no) 569 569 { 570 - return i2c_mux_add_adapter(dev->muxc, 571 - 0, 572 - mux_no /* chan_id */, 573 - 0 /* class */); 570 + return i2c_mux_add_adapter(dev->muxc, 0, mux_no); 574 571 } 575 572 576 573 void cx231xx_i2c_mux_unregister(struct cx231xx *dev)
+1 -1
drivers/of/unittest.c
··· 2815 2815 if (!muxc) 2816 2816 return -ENOMEM; 2817 2817 for (i = 0; i < nchans; i++) { 2818 - if (i2c_mux_add_adapter(muxc, 0, i, 0)) { 2818 + if (i2c_mux_add_adapter(muxc, 0, i)) { 2819 2819 dev_err(dev, "Failed to register mux #%d\n", i); 2820 2820 i2c_mux_del_adapters(muxc); 2821 2821 return -ENODEV;
+1 -2
include/linux/i2c-mux.h
··· 56 56 * callback functions to perform hardware-specific mux control. 57 57 */ 58 58 int i2c_mux_add_adapter(struct i2c_mux_core *muxc, 59 - u32 force_nr, u32 chan_id, 60 - unsigned int class); 59 + u32 force_nr, u32 chan_id); 61 60 62 61 void i2c_mux_del_adapters(struct i2c_mux_core *muxc); 63 62