Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 137853
b: refs/heads/master
c: 45d8094
h: refs/heads/master
i:
  137851: 9c82c08
v: v3
  • Loading branch information
Hans Verkuil authored and Mauro Carvalho Chehab committed Mar 30, 2009
1 parent dc81405 commit 3e17ce9
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ef77a26be1883366bb78741d1808e5c86a14ec76
refs/heads/master: 45d809431daaa3ab01f877388d09676d05b469be
2 changes: 1 addition & 1 deletion trunk/drivers/media/common/saa7146_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -516,7 +516,7 @@ static int saa7146_init_one(struct pci_dev *pci, const struct pci_device_id *ent
static void saa7146_remove_one(struct pci_dev *pdev)
{
struct v4l2_device *v4l2_dev = pci_get_drvdata(pdev);
struct saa7146_dev *dev = container_of(v4l2_dev, struct saa7146_dev, v4l2_dev);
struct saa7146_dev *dev = to_saa7146_dev(v4l2_dev);
struct {
void *addr;
dma_addr_t dma;
Expand Down
5 changes: 3 additions & 2 deletions trunk/drivers/media/common/saa7146_i2c.c
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,8 @@ static int saa7146_i2c_transfer(struct saa7146_dev *dev, const struct i2c_msg *m
/* utility functions */
static int saa7146_i2c_xfer(struct i2c_adapter* adapter, struct i2c_msg *msg, int num)
{
struct saa7146_dev* dev = i2c_get_adapdata(adapter);
struct v4l2_device *v4l2_dev = i2c_get_adapdata(adapter);
struct saa7146_dev *dev = to_saa7146_dev(v4l2_dev);

/* use helper function to transfer data */
return saa7146_i2c_transfer(dev, msg, num, adapter->retries);
Expand Down Expand Up @@ -419,7 +420,7 @@ int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c

if( NULL != i2c_adapter ) {
BUG_ON(!i2c_adapter->class);
i2c_set_adapdata(i2c_adapter,dev);
i2c_set_adapdata(i2c_adapter, &dev->v4l2_dev);
i2c_adapter->dev.parent = &dev->pci->dev;
i2c_adapter->algo = &saa7146_algo;
i2c_adapter->algo_data = NULL;
Expand Down
5 changes: 5 additions & 0 deletions trunk/include/media/saa7146.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,11 @@ struct saa7146_dev
struct saa7146_dma d_rps1;
};

static inline struct saa7146_dev *to_saa7146_dev(struct v4l2_device *v4l2_dev)
{
return container_of(v4l2_dev, struct saa7146_dev, v4l2_dev);
}

/* from saa7146_i2c.c */
int saa7146_i2c_adapter_prepare(struct saa7146_dev *dev, struct i2c_adapter *i2c_adapter, u32 bitrate);

Expand Down

0 comments on commit 3e17ce9

Please sign in to comment.