aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media
diff options
context:
space:
mode:
authorHarvey Harrison <harvey.harrison@gmail.com>2008-04-15 21:22:11 -0400
committerMauro Carvalho Chehab <mchehab@infradead.org>2008-07-20 06:05:10 -0400
commit5ad6b816e2227a7daf9569f1dbb8d7af90b387b2 (patch)
tree1eba6cb4c04d5f62fb80eddce5c3c81ff66ce9a8 /drivers/media
parent5b664cb235e97afbf34db9c4d77f08ebd725335e (diff)
V4L/DVB (7586): radio: use get/put_unaligned_* helpers
Signed-off-by: Harvey Harrison <harvey.harrison@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
Diffstat (limited to 'drivers/media')
-rw-r--r--drivers/media/radio/radio-si470x.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/drivers/media/radio/radio-si470x.c b/drivers/media/radio/radio-si470x.c
index 77354ca6e8e9..5dd33197bbdd 100644
--- a/drivers/media/radio/radio-si470x.c
+++ b/drivers/media/radio/radio-si470x.c
@@ -521,8 +521,7 @@ static int si470x_get_register(struct si470x_device *radio, int regnr)
521 retval = si470x_get_report(radio, (void *) &buf, sizeof(buf)); 521 retval = si470x_get_report(radio, (void *) &buf, sizeof(buf));
522 522
523 if (retval >= 0) 523 if (retval >= 0)
524 radio->registers[regnr] = be16_to_cpu(get_unaligned( 524 radio->registers[regnr] = get_unaligned_be16(&buf[1]);
525 (unsigned short *) &buf[1]));
526 525
527 return (retval < 0) ? -EINVAL : 0; 526 return (retval < 0) ? -EINVAL : 0;
528} 527}
@@ -537,8 +536,7 @@ static int si470x_set_register(struct si470x_device *radio, int regnr)
537 int retval; 536 int retval;
538 537
539 buf[0] = REGISTER_REPORT(regnr); 538 buf[0] = REGISTER_REPORT(regnr);
540 put_unaligned(cpu_to_be16(radio->registers[regnr]), 539 put_unaligned_be16(radio->registers[regnr], &buf[1]);
541 (unsigned short *) &buf[1]);
542 540
543 retval = si470x_set_report(radio, (void *) &buf, sizeof(buf)); 541 retval = si470x_set_report(radio, (void *) &buf, sizeof(buf));
544 542
@@ -561,9 +559,8 @@ static int si470x_get_all_registers(struct si470x_device *radio)
561 559
562 if (retval >= 0) 560 if (retval >= 0)
563 for (regnr = 0; regnr < RADIO_REGISTER_NUM; regnr++) 561 for (regnr = 0; regnr < RADIO_REGISTER_NUM; regnr++)
564 radio->registers[regnr] = be16_to_cpu(get_unaligned( 562 radio->registers[regnr] = get_unaligned_be16(
565 (unsigned short *) 563 &buf[regnr * RADIO_REGISTER_SIZE + 1]);
566 &buf[regnr * RADIO_REGISTER_SIZE + 1]));
567 564
568 return (retval < 0) ? -EINVAL : 0; 565 return (retval < 0) ? -EINVAL : 0;
569} 566}
@@ -594,8 +591,7 @@ static int si470x_get_rds_registers(struct si470x_device *radio)
594 if (retval >= 0) 591 if (retval >= 0)
595 for (regnr = 0; regnr < RDS_REGISTER_NUM; regnr++) 592 for (regnr = 0; regnr < RDS_REGISTER_NUM; regnr++)
596 radio->registers[STATUSRSSI + regnr] = 593 radio->registers[STATUSRSSI + regnr] =
597 be16_to_cpu(get_unaligned((unsigned short *) 594 get_unaligned_be16(&buf[regnr * RADIO_REGISTER_SIZE + 1]);
598 &buf[regnr * RADIO_REGISTER_SIZE + 1]));
599 595
600 return (retval < 0) ? -EINVAL : 0; 596 return (retval < 0) ? -EINVAL : 0;
601} 597}
@@ -843,7 +839,7 @@ static void si470x_rds(struct si470x_device *radio)
843 }; 839 };
844 840
845 /* Fill the V4L2 RDS buffer */ 841 /* Fill the V4L2 RDS buffer */
846 put_unaligned(cpu_to_le16(rds), (unsigned short *) &tmpbuf); 842 put_unaligned_le16(rds, &tmpbuf);
847 tmpbuf[2] = blocknum; /* offset name */ 843 tmpbuf[2] = blocknum; /* offset name */
848 tmpbuf[2] |= blocknum << 3; /* received offset */ 844 tmpbuf[2] |= blocknum << 3; /* received offset */
849 if (bler > max_rds_errors) 845 if (bler > max_rds_errors)