From: David Brownell <david-b-yBeKhBN/0LDR7s880joybQ@public.gmane.org>
To: i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
Subject: [patch/rft 2.6.26-rc1] i2c-core: remove i2c_adapter.clients
Date: Sun, 4 May 2008 21:26:26 -0700 [thread overview]
Message-ID: <200805042126.26504.david-b@pacbell.net> (raw)
Remove I2C core state that duplicates driver model state: a list of
children of a given adapter (i2c_adapter.clients, i2c_client.list) and
a lock (i2c_adapter.clist_lock) protecting it.
Depends on the previous patch which removes the last uses of this list.
Signed-off-by: David Brownell <dbrownell-Rn4VEauK+AKRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
---
Also presumes there are no more users of this list outside i2c-core;
ISTR that was fixed some time ago. But maybe that's wrong.
drivers/i2c/i2c-core.c | 15 ---------------
include/linux/i2c.h | 4 ----
2 files changed, 19 deletions(-)
--- g26.orig/drivers/i2c/i2c-core.c 2008-05-04 20:55:46.000000000 -0700
+++ g26/drivers/i2c/i2c-core.c 2008-05-04 20:55:55.000000000 -0700
@@ -310,7 +310,6 @@ EXPORT_SYMBOL_GPL(i2c_new_device);
*/
void i2c_unregister_device(struct i2c_client *client)
{
- struct i2c_adapter *adapter = client->adapter;
struct i2c_driver *driver = client->driver;
if (driver && !is_newstyle_driver(driver)) {
@@ -320,10 +319,6 @@ void i2c_unregister_device(struct i2c_cl
return;
}
- mutex_lock(&adapter->clist_lock);
- list_del(&client->list);
- mutex_unlock(&adapter->clist_lock);
-
device_unregister(&client->dev);
}
EXPORT_SYMBOL_GPL(i2c_unregister_device);
@@ -551,8 +546,6 @@ static int i2c_register_adapter(struct i
int res = 0, dummy;
mutex_init(&adap->bus_lock);
- mutex_init(&adap->clist_lock);
- INIT_LIST_HEAD(&adap->clients);
/* Setup SMBALERT# infrastructure. */
INIT_WORK(&adap->alert, smbus_alert);
@@ -962,10 +955,6 @@ int i2c_attach_client(struct i2c_client
if (res)
goto out_err;
- mutex_lock(&adapter->clist_lock);
- list_add_tail(&client->list, &adapter->clients);
- mutex_unlock(&adapter->clist_lock);
-
dev_dbg(&adapter->dev, "client [%s] registered with bus id %s\n",
client->name, client->dev.bus_id);
@@ -1001,10 +990,6 @@ int i2c_detach_client(struct i2c_client
}
}
- mutex_lock(&adapter->clist_lock);
- list_del(&client->list);
- mutex_unlock(&adapter->clist_lock);
-
init_completion(&client->released);
device_unregister(&client->dev);
wait_for_completion(&client->released);
--- g26.orig/include/linux/i2c.h 2008-05-04 20:55:46.000000000 -0700
+++ g26/include/linux/i2c.h 2008-05-04 20:55:55.000000000 -0700
@@ -163,7 +163,6 @@ struct i2c_driver {
* @irq: indicates the IRQ generated by this device (if any)
* @driver_name: Identifies new-style driver used with this device; also
* used as the module name for hotplug/coldplug modprobe support.
- * @list: list of active/busy clients (DEPRECATED)
* @released: used to synchronize client releases & detaches and references
*
* An i2c_client identifies a single device (i.e. chip) connected to an
@@ -181,7 +180,6 @@ struct i2c_client {
struct device dev; /* the device structure */
int irq; /* irq issued by device (or -1) */
char driver_name[KOBJ_NAME_LEN];
- struct list_head list; /* DEPRECATED */
struct completion released;
};
#define to_i2c_client(d) container_of(d, struct i2c_client, dev)
@@ -328,14 +326,12 @@ struct i2c_adapter {
/* data fields that are valid for all devices */
u8 level; /* nesting level for lockdep */
struct mutex bus_lock;
- struct mutex clist_lock;
int timeout;
int retries;
struct device dev; /* the adapter device */
int nr;
- struct list_head clients; /* DEPRECATED */
char name[48];
struct completion dev_released;
_______________________________________________
i2c mailing list
i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org
http://lists.lm-sensors.org/mailman/listinfo/i2c
reply other threads:[~2008-05-05 4:26 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=200805042126.26504.david-b@pacbell.net \
--to=david-b-ybekhbn/0ldr7s880joybq@public.gmane.org \
--cc=i2c-GZX6beZjE8VD60Wz+7aTrA@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox