V4L/DVB (7586): radio: use get/put_unaligned_* helpers
authorHarvey Harrison <harvey.harrison@gmail.com>
Wed, 16 Apr 2008 01:22:11 +0000 (22:22 -0300)
committerMauro Carvalho Chehab <mchehab@infradead.org>
Sun, 20 Jul 2008 10:05:10 +0000 (07:05 -0300)
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>
drivers/media/radio/radio-si470x.c

index 77354ca6e8e928005cfcf631ed97d698bfd9b1ab..5dd33197bbdd91de06406f6c244c2589ec636d77 100644 (file)
@@ -521,8 +521,7 @@ static int si470x_get_register(struct si470x_device *radio, int regnr)
        retval = si470x_get_report(radio, (void *) &buf, sizeof(buf));
 
        if (retval >= 0)
-               radio->registers[regnr] = be16_to_cpu(get_unaligned(
-                       (unsigned short *) &buf[1]));
+               radio->registers[regnr] = get_unaligned_be16(&buf[1]);
 
        return (retval < 0) ? -EINVAL : 0;
 }
@@ -537,8 +536,7 @@ static int si470x_set_register(struct si470x_device *radio, int regnr)
        int retval;
 
        buf[0] = REGISTER_REPORT(regnr);
-       put_unaligned(cpu_to_be16(radio->registers[regnr]),
-               (unsigned short *) &buf[1]);
+       put_unaligned_be16(radio->registers[regnr], &buf[1]);
 
        retval = si470x_set_report(radio, (void *) &buf, sizeof(buf));
 
@@ -561,9 +559,8 @@ static int si470x_get_all_registers(struct si470x_device *radio)
 
        if (retval >= 0)
                for (regnr = 0; regnr < RADIO_REGISTER_NUM; regnr++)
-                       radio->registers[regnr] = be16_to_cpu(get_unaligned(
-                               (unsigned short *)
-                               &buf[regnr * RADIO_REGISTER_SIZE + 1]));
+                       radio->registers[regnr] = get_unaligned_be16(
+                               &buf[regnr * RADIO_REGISTER_SIZE + 1]);
 
        return (retval < 0) ? -EINVAL : 0;
 }
@@ -594,8 +591,7 @@ static int si470x_get_rds_registers(struct si470x_device *radio)
        if (retval >= 0)
                for (regnr = 0; regnr < RDS_REGISTER_NUM; regnr++)
                        radio->registers[STATUSRSSI + regnr] =
-                               be16_to_cpu(get_unaligned((unsigned short *)
-                               &buf[regnr * RADIO_REGISTER_SIZE + 1]));
+                               get_unaligned_be16(&buf[regnr * RADIO_REGISTER_SIZE + 1]);
 
        return (retval < 0) ? -EINVAL : 0;
 }
@@ -843,7 +839,7 @@ static void si470x_rds(struct si470x_device *radio)
                };
 
                /* Fill the V4L2 RDS buffer */
-               put_unaligned(cpu_to_le16(rds), (unsigned short *) &tmpbuf);
+               put_unaligned_le16(rds, &tmpbuf);
                tmpbuf[2] = blocknum;           /* offset name */
                tmpbuf[2] |= blocknum << 3;     /* received offset */
                if (bler > max_rds_errors)