Merge branch 'v4l_for_2.6.35' of git://git.kernel.org/pub/scm/linux/kernel/git/mcheha...
[safe/jmp/linux-2.6] / drivers / media / video / rj54n1cb0c.c
index 805226e..47fd207 100644 (file)
@@ -165,7 +165,7 @@ struct rj54n1_reg_val {
        u8 val;
 };
 
-const static struct rj54n1_reg_val bank_4[] = {
+static const struct rj54n1_reg_val bank_4[] = {
        {0x417, 0},
        {0x42c, 0},
        {0x42d, 0xf0},
@@ -186,7 +186,7 @@ const static struct rj54n1_reg_val bank_4[] = {
        {0x4fe, 2},
 };
 
-const static struct rj54n1_reg_val bank_5[] = {
+static const struct rj54n1_reg_val bank_5[] = {
        {0x514, 0},
        {0x516, 0},
        {0x518, 0},
@@ -207,7 +207,7 @@ const static struct rj54n1_reg_val bank_5[] = {
        {0x5fe, 2},
 };
 
-const static struct rj54n1_reg_val bank_7[] = {
+static const struct rj54n1_reg_val bank_7[] = {
        {0x70a, 0},
        {0x714, 0xff},
        {0x715, 0xff},
@@ -215,7 +215,7 @@ const static struct rj54n1_reg_val bank_7[] = {
        {0x7FE, 2},
 };
 
-const static struct rj54n1_reg_val bank_8[] = {
+static const struct rj54n1_reg_val bank_8[] = {
        {0x800, 0x00},
        {0x801, 0x01},
        {0x802, 0x61},
@@ -403,12 +403,12 @@ const static struct rj54n1_reg_val bank_8[] = {
        {0x8FE, 2},
 };
 
-const static struct rj54n1_reg_val bank_10[] = {
+static const struct rj54n1_reg_val bank_10[] = {
        {0x10bf, 0x69}
 };
 
 /* Clock dividers - these are default register values, divider = register + 1 */
-const static struct rj54n1_clock_div clk_div = {
+static const struct rj54n1_clock_div clk_div = {
        .ratio_tg       = 3 /* default: 5 */,
        .ratio_t        = 4 /* default: 1 */,
        .ratio_r        = 4 /* default: 0 */,
@@ -481,10 +481,10 @@ static int reg_write_multiple(struct i2c_client *client,
        return 0;
 }
 
-static int rj54n1_enum_fmt(struct v4l2_subdev *sd, int index,
+static int rj54n1_enum_fmt(struct v4l2_subdev *sd, unsigned int index,
                           enum v4l2_mbus_pixelcode *code)
 {
-       if ((unsigned int)index >= ARRAY_SIZE(rj54n1_colour_fmts))
+       if (index >= ARRAY_SIZE(rj54n1_colour_fmts))
                return -EINVAL;
 
        *code = rj54n1_colour_fmts[index].code;
@@ -555,15 +555,15 @@ static int rj54n1_commit(struct i2c_client *client)
        return ret;
 }
 
-static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h,
-                              u32 *out_w, u32 *out_h);
+static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h,
+                              s32 *out_w, s32 *out_h);
 
 static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
 {
        struct i2c_client *client = sd->priv;
        struct rj54n1 *rj54n1 = to_rj54n1(client);
        struct v4l2_rect *rect = &a->c;
-       unsigned int dummy = 0, output_w, output_h,
+       int dummy = 0, output_w, output_h,
                input_w = rect->width, input_h = rect->height;
        int ret;
 
@@ -577,7 +577,7 @@ static int rj54n1_s_crop(struct v4l2_subdev *sd, struct v4l2_crop *a)
        output_w = (input_w * 1024 + rj54n1->resize / 2) / rj54n1->resize;
        output_h = (input_h * 1024 + rj54n1->resize / 2) / rj54n1->resize;
 
-       dev_dbg(&client->dev, "Scaling for %ux%u : %u = %ux%u\n",
+       dev_dbg(&client->dev, "Scaling for %dx%d : %u = %dx%d\n",
                input_w, input_h, rj54n1->resize, output_w, output_h);
 
        ret = rj54n1_sensor_scale(sd, &input_w, &input_h, &output_w, &output_h);
@@ -638,8 +638,8 @@ static int rj54n1_g_fmt(struct v4l2_subdev *sd,
  * the output one, updates the window sizes and returns an error or the resize
  * coefficient on success. Note: we only use the "Fixed Scaling" on this camera.
  */
-static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h,
-                              u32 *out_w, u32 *out_h)
+static int rj54n1_sensor_scale(struct v4l2_subdev *sd, s32 *in_w, s32 *in_h,
+                              s32 *out_w, s32 *out_h)
 {
        struct i2c_client *client = sd->priv;
        struct rj54n1 *rj54n1 = to_rj54n1(client);
@@ -749,7 +749,7 @@ static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h,
         * improve the image quality or stability for larger frames (see comment
         * above), but I didn't check the framerate.
         */
-       skip = min(resize / 1024, (unsigned)15);
+       skip = min(resize / 1024, 15U);
 
        inc_sel = 1 << skip;
 
@@ -819,7 +819,7 @@ static int rj54n1_sensor_scale(struct v4l2_subdev *sd, u32 *in_w, u32 *in_h,
        *out_w = output_w;
        *out_h = output_h;
 
-       dev_dbg(&client->dev, "Scaled for %ux%u : %u = %ux%u, skip %u\n",
+       dev_dbg(&client->dev, "Scaled for %dx%d : %u = %ux%u, skip %u\n",
                *in_w, *in_h, resize, output_w, output_h, skip);
 
        return resize;
@@ -1017,7 +1017,7 @@ static int rj54n1_s_fmt(struct v4l2_subdev *sd,
        struct i2c_client *client = sd->priv;
        struct rj54n1 *rj54n1 = to_rj54n1(client);
        const struct rj54n1_datafmt *fmt;
-       unsigned int output_w, output_h, max_w, max_h,
+       int output_w, output_h, max_w, max_h,
                input_w = rj54n1->rect.width, input_h = rj54n1->rect.height;
        int ret;
 
@@ -1444,7 +1444,6 @@ static int rj54n1_probe(struct i2c_client *client,
        ret = rj54n1_video_probe(icd, client, rj54n1_priv);
        if (ret < 0) {
                icd->ops = NULL;
-               i2c_set_clientdata(client, NULL);
                kfree(rj54n1);
                return ret;
        }
@@ -1461,7 +1460,6 @@ static int rj54n1_remove(struct i2c_client *client)
        icd->ops = NULL;
        if (icl->free_bus)
                icl->free_bus(icl);
-       i2c_set_clientdata(client, NULL);
        client->driver = NULL;
        kfree(rj54n1);