Skip to content

Commit

Permalink
V4L/DVB (13410): firedtv: remove an unnecessary function argument
Browse files Browse the repository at this point in the history
All read transactions initiated by firedtv are only quadlet-sized, hence
the backend->read call can be simplified a little.

Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
  • Loading branch information
Stefan Richter authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent b1d33f4 commit 5375659
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 10 deletions.
4 changes: 2 additions & 2 deletions drivers/media/dvb/firewire/firedtv-1394.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ static int node_lock(struct firedtv *fdtv, u64 addr, __be32 data[])
return ret;
}

static int node_read(struct firedtv *fdtv, u64 addr, void *data, size_t len)
static int node_read(struct firedtv *fdtv, u64 addr, void *data)
{
return hpsb_node_read(node_of(fdtv), addr, data, len);
return hpsb_node_read(node_of(fdtv), addr, data, 4);
}

static int node_write(struct firedtv *fdtv, u64 addr, void *data, size_t len)
Expand Down
8 changes: 4 additions & 4 deletions drivers/media/dvb/firewire/firedtv-avc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1236,14 +1236,14 @@ int avc_ca_get_mmi(struct firedtv *fdtv, char *mmi_object, unsigned int *len)

#define CMP_OUTPUT_PLUG_CONTROL_REG_0 0xfffff0000904ULL

static int cmp_read(struct firedtv *fdtv, void *buf, u64 addr, size_t len)
static int cmp_read(struct firedtv *fdtv, u64 addr, __be32 *data)
{
int ret;

if (mutex_lock_interruptible(&fdtv->avc_mutex))
return -EINTR;

ret = fdtv->backend->read(fdtv, addr, buf, len);
ret = fdtv->backend->read(fdtv, addr, data);
if (ret < 0)
dev_err(fdtv->device, "CMP: read I/O error\n");

Expand Down Expand Up @@ -1293,7 +1293,7 @@ int cmp_establish_pp_connection(struct firedtv *fdtv, int plug, int channel)
int attempts = 0;
int ret;

ret = cmp_read(fdtv, opcr, opcr_address, 4);
ret = cmp_read(fdtv, opcr_address, opcr);
if (ret < 0)
return ret;

Expand Down Expand Up @@ -1357,7 +1357,7 @@ void cmp_break_pp_connection(struct firedtv *fdtv, int plug, int channel)
u64 opcr_address = CMP_OUTPUT_PLUG_CONTROL_REG_0 + (plug << 2);
int attempts = 0;

if (cmp_read(fdtv, opcr, opcr_address, 4) < 0)
if (cmp_read(fdtv, opcr_address, opcr) < 0)
return;

repeat:
Expand Down
5 changes: 2 additions & 3 deletions drivers/media/dvb/firewire/firedtv-fw.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,9 @@ static int node_lock(struct firedtv *fdtv, u64 addr, __be32 data[])
return node_req(fdtv, addr, data, 8, TCODE_LOCK_COMPARE_SWAP);
}

static int node_read(struct firedtv *fdtv, u64 addr, void *data, size_t len)
static int node_read(struct firedtv *fdtv, u64 addr, void *data)
{
return node_req(fdtv, addr, data, len, len == 4 ?
TCODE_READ_QUADLET_REQUEST : TCODE_READ_BLOCK_REQUEST);
return node_req(fdtv, addr, data, 4, TCODE_READ_QUADLET_REQUEST);
}

static int node_write(struct firedtv *fdtv, u64 addr, void *data, size_t len)
Expand Down
2 changes: 1 addition & 1 deletion drivers/media/dvb/firewire/firedtv.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ struct firedtv;

struct firedtv_backend {
int (*lock)(struct firedtv *fdtv, u64 addr, __be32 data[]);
int (*read)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
int (*read)(struct firedtv *fdtv, u64 addr, void *data);
int (*write)(struct firedtv *fdtv, u64 addr, void *data, size_t len);
int (*start_iso)(struct firedtv *fdtv);
void (*stop_iso)(struct firedtv *fdtv);
Expand Down

0 comments on commit 5375659

Please sign in to comment.