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

Commit 1684a984 authored by Jean Delvare's avatar Jean Delvare Committed by Greg Kroah-Hartman
Browse files

[PATCH] I2C: Kill i2c_algorithm.id (6/7)



In theory, there should be no more users of I2C_ALGO_* at this point.
However, it happens that several drivers were using I2C_ALGO_* for
adapter ids, so we need to correct these before we can get rid of all
the I2C_ALGO_* definitions.

Note that this also fixes a bug in media/video/tvaudio.c:

	/* don't attach on saa7146 based cards,
	   because dedicated drivers are used */
	if ((adap->id & I2C_ALGO_SAA7146))
		return 0;

This test was plain broken, as it would succeed for many more adapters
than just the saa7146: any those id would share at least one bit with
the saa7146 id. We are really lucky that the few other adapters we want
this driver to work with did not fulfill that condition.

Signed-off-by: default avatarJean Delvare <khali@linux-fr.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent c7a46533
Loading
Loading
Loading
Loading
+0 −1
Original line number Original line Diff line number Diff line
@@ -619,7 +619,6 @@ create_iface(struct device_node *np, struct device *dev)
		sprintf(chan->adapter.name, "%s %d", np->parent->name, i);
		sprintf(chan->adapter.name, "%s %d", np->parent->name, i);
		chan->iface = iface;
		chan->iface = iface;
		chan->chan_no = i;
		chan->chan_no = i;
		chan->adapter.id = I2C_ALGO_SMBUS;
		chan->adapter.algo = &keywest_algorithm;
		chan->adapter.algo = &keywest_algorithm;
		chan->adapter.algo_data = NULL;
		chan->adapter.algo_data = NULL;
		chan->adapter.client_register = NULL;
		chan->adapter.client_register = NULL;
+1 −1
Original line number Original line Diff line number Diff line
@@ -454,7 +454,7 @@ static int __init scx200_acb_create(int base, int index)
	i2c_set_adapdata(adapter, iface);
	i2c_set_adapdata(adapter, iface);
	snprintf(adapter->name, I2C_NAME_SIZE, "SCx200 ACB%d", index);
	snprintf(adapter->name, I2C_NAME_SIZE, "SCx200 ACB%d", index);
	adapter->owner = THIS_MODULE;
	adapter->owner = THIS_MODULE;
	adapter->id = I2C_ALGO_SMBUS;
	adapter->id = I2C_HW_SMBUS_SCX200;
	adapter->algo = &scx200_acb_algorithm;
	adapter->algo = &scx200_acb_algorithm;
	adapter->class = I2C_CLASS_HWMON;
	adapter->class = I2C_CLASS_HWMON;


+1 −1
Original line number Original line Diff line number Diff line
@@ -410,7 +410,7 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c
#endif
#endif
		i2c_adapter->algo	   = &saa7146_algo;
		i2c_adapter->algo	   = &saa7146_algo;
		i2c_adapter->algo_data     = NULL;
		i2c_adapter->algo_data     = NULL;
		i2c_adapter->id		   = I2C_ALGO_SAA7146;
		i2c_adapter->id		   = I2C_HW_SAA7146;
		i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
		i2c_adapter->timeout = SAA7146_I2C_TIMEOUT;
		i2c_adapter->retries = SAA7146_I2C_RETRIES;
		i2c_adapter->retries = SAA7146_I2C_RETRIES;
	}
	}
+0 −1
Original line number Original line Diff line number Diff line
@@ -190,7 +190,6 @@ int flexcop_i2c_init(struct flexcop_device *fc)
	fc->i2c_adap.class	    = I2C_CLASS_TV_DIGITAL;
	fc->i2c_adap.class	    = I2C_CLASS_TV_DIGITAL;
	fc->i2c_adap.algo       = &flexcop_algo;
	fc->i2c_adap.algo       = &flexcop_algo;
	fc->i2c_adap.algo_data  = NULL;
	fc->i2c_adap.algo_data  = NULL;
	fc->i2c_adap.id         = I2C_ALGO_BIT;


	if ((ret = i2c_add_adapter(&fc->i2c_adap)) < 0)
	if ((ret = i2c_add_adapter(&fc->i2c_adap)) < 0)
		return ret;
		return ret;
+0 −1
Original line number Original line Diff line number Diff line
@@ -27,7 +27,6 @@ int dvb_usb_i2c_init(struct dvb_usb_device *d)
#endif
#endif
	d->i2c_adap.algo      = d->props.i2c_algo;
	d->i2c_adap.algo      = d->props.i2c_algo;
	d->i2c_adap.algo_data = NULL;
	d->i2c_adap.algo_data = NULL;
	d->i2c_adap.id        = I2C_ALGO_BIT;


	i2c_set_adapdata(&d->i2c_adap, d);
	i2c_set_adapdata(&d->i2c_adap, d);


Loading