summaryrefslogtreecommitdiff
path: root/linux/drivers/media/dvb/dvb-core
diff options
context:
space:
mode:
authorAndreas Oberritter <devnull@localhost>2003-10-08 23:12:46 +0000
committerAndreas Oberritter <devnull@localhost>2003-10-08 23:12:46 +0000
commit211cbd901aa45d1e325986fb9709ea774c4f29f7 (patch)
treeca4aabb2420f9555202e568f17d05b2016557d66 /linux/drivers/media/dvb/dvb-core
parent20bef24e32fbba770db1a3f6f2481745ea25603e (diff)
downloadmediapointer-dvb-s2-211cbd901aa45d1e325986fb9709ea774c4f29f7.tar.gz
mediapointer-dvb-s2-211cbd901aa45d1e325986fb9709ea774c4f29f7.tar.bz2
- allow private data to be associated with i2c devices
- fixed some return values in i2c device attach functions
Diffstat (limited to 'linux/drivers/media/dvb/dvb-core')
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_i2c.c15
-rw-r--r--linux/drivers/media/dvb/dvb-core/dvb_i2c.h6
2 files changed, 11 insertions, 10 deletions
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
index 0159d8d1c..7be068ac6 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
+++ b/linux/drivers/media/dvb/dvb-core/dvb_i2c.c
@@ -32,8 +32,9 @@
struct dvb_i2c_device {
struct list_head list_head;
struct module *owner;
- int (*attach) (struct dvb_i2c_bus *i2c);
- void (*detach) (struct dvb_i2c_bus *i2c);
+ int (*attach) (struct dvb_i2c_bus *i2c, void **data);
+ void (*detach) (struct dvb_i2c_bus *i2c, void *data);
+ void *data;
};
LIST_HEAD(dvb_i2c_buslist);
@@ -66,7 +67,7 @@ static void try_attach_device (struct dvb_i2c_bus *i2c, struct dvb_i2c_device *d
return;
}
- if (dev->attach (i2c) == 0) {
+ if (dev->attach (i2c, &dev->data) == 0) {
register_i2c_client (i2c, dev);
} else {
if (dev->owner)
@@ -77,7 +78,7 @@ static void try_attach_device (struct dvb_i2c_bus *i2c, struct dvb_i2c_device *d
static void detach_device (struct dvb_i2c_bus *i2c, struct dvb_i2c_device *dev)
{
- dev->detach (i2c);
+ dev->detach (i2c, dev->data);
if (dev->owner)
module_put (dev->owner);
@@ -229,8 +230,8 @@ void dvb_unregister_i2c_bus (int (*xfer) (struct dvb_i2c_bus *i2c,
int dvb_register_i2c_device (struct module *owner,
- int (*attach) (struct dvb_i2c_bus *i2c),
- void (*detach) (struct dvb_i2c_bus *i2c))
+ int (*attach) (struct dvb_i2c_bus *i2c, void **data),
+ void (*detach) (struct dvb_i2c_bus *i2c, void *data))
{
struct dvb_i2c_device *entry;
@@ -256,7 +257,7 @@ int dvb_register_i2c_device (struct module *owner,
}
-int dvb_unregister_i2c_device (int (*attach) (struct dvb_i2c_bus *i2c))
+int dvb_unregister_i2c_device (int (*attach) (struct dvb_i2c_bus *i2c, void **data))
{
struct list_head *entry, *n;
diff --git a/linux/drivers/media/dvb/dvb-core/dvb_i2c.h b/linux/drivers/media/dvb/dvb-core/dvb_i2c.h
index 1df192448..3e9cb6870 100644
--- a/linux/drivers/media/dvb/dvb-core/dvb_i2c.h
+++ b/linux/drivers/media/dvb/dvb-core/dvb_i2c.h
@@ -54,10 +54,10 @@ void dvb_unregister_i2c_bus (int (*xfer) (struct dvb_i2c_bus *i2c,
extern int dvb_register_i2c_device (struct module *owner,
- int (*attach) (struct dvb_i2c_bus *i2c),
- void (*detach) (struct dvb_i2c_bus *i2c));
+ int (*attach) (struct dvb_i2c_bus *i2c, void **data),
+ void (*detach) (struct dvb_i2c_bus *i2c, void *data));
-extern int dvb_unregister_i2c_device (int (*attach) (struct dvb_i2c_bus *i2c));
+extern int dvb_unregister_i2c_device (int (*attach) (struct dvb_i2c_bus *i2c, void **data));
#endif