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

Commit fe9d1159 authored by Linus Torvalds's avatar Linus Torvalds
Browse files
* 'i2c-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jdelvare/staging:
  i2c: Sanity checks on adapter registration
  i2c: Mark i2c_adapter.id as deprecated
  i2c: Drivers shouldn't include <linux/i2c-id.h>
  i2c: Delete unused adapter IDs
  i2c: Remove obsolete cleanup for clientdata
parents e5c13537 2236baa7
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -554,3 +554,13 @@ Why: This is a legacy interface which have been replaced by a more
Who:    NeilBrown <neilb@suse.de>

----------------------------

What:	i2c_adapter.id
When:	June 2011
Why:	This field is deprecated. I2C device drivers shouldn't change their
	behavior based on the underlying I2C adapter. Instead, the I2C
	adapter driver should instantiate the I2C devices and provide the
	needed platform-specific information.
Who:	Jean Delvare <khali@linux-fr.org>

----------------------------
+12 −0
Original line number Diff line number Diff line
@@ -848,6 +848,18 @@ static int i2c_register_adapter(struct i2c_adapter *adap)
		goto out_list;
	}

	/* Sanity checks */
	if (unlikely(adap->name[0] == '\0')) {
		pr_err("i2c-core: Attempt to register an adapter with "
		       "no name!\n");
		return -EINVAL;
	}
	if (unlikely(!adap->algo)) {
		pr_err("i2c-core: Attempt to register adapter '%s' with "
		       "no algo!\n", adap->name);
		return -EINVAL;
	}

	rt_mutex_init(&adap->bus_lock);
	mutex_init(&adap->userspace_clients_lock);
	INIT_LIST_HEAD(&adap->userspace_clients);
+0 −1
Original line number Diff line number Diff line
@@ -120,7 +120,6 @@ struct i2c_adapter *i2c_add_mux_adapter(struct i2c_adapter *parent,
	snprintf(priv->adap.name, sizeof(priv->adap.name),
		 "i2c-%d-mux (chan_id %d)", i2c_adapter_id(parent), chan_id);
	priv->adap.owner = THIS_MODULE;
	priv->adap.id = parent->id;
	priv->adap.algo = &priv->algo;
	priv->adap.algo_data = priv;
	priv->adap.dev.parent = &parent->dev;
+0 −1
Original line number Diff line number Diff line
@@ -391,7 +391,6 @@ static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, in

/*****************************************************************************/
/* i2c-adapter helper functions                                              */
#include <linux/i2c-id.h>

/* exported algorithm data */
static struct i2c_algorithm saa7146_algo = {
+0 −2
Original line number Diff line number Diff line
@@ -451,7 +451,6 @@ static int imx074_probe(struct i2c_client *client,
	ret = imx074_video_probe(icd, client);
	if (ret < 0) {
		icd->ops = NULL;
		i2c_set_clientdata(client, NULL);
		kfree(priv);
		return ret;
	}
@@ -468,7 +467,6 @@ static int imx074_remove(struct i2c_client *client)
	icd->ops = NULL;
	if (icl->free_bus)
		icl->free_bus(icl);
	i2c_set_clientdata(client, NULL);
	client->driver = NULL;
	kfree(priv);

Loading