Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff --git a/drivers/media/i2c/smia/et8ek8.c b/drivers/media/i2c/smia/et8ek8.c
- index cd66a27..12e55bc 100644
- --- a/drivers/media/i2c/smia/et8ek8.c
- +++ b/drivers/media/i2c/smia/et8ek8.c
- @@ -673,16 +673,16 @@ static struct smia_meta_reglist et8ek8_smia_meta_reglist = {
- .magic = SMIA_MAGIC,
- .version = "V14 03-June-2008",
- .reglist = {
- - { .offset = (uintptr_t)&mode1_poweron_mode2_16vga_2592x1968_12_07fps },
- - { .offset = (uintptr_t)&mode1_16vga_2592x1968_13_12fps_dpcm10_8 },
- - { .offset = (uintptr_t)&mode3_4vga_1296x984_29_99fps_dpcm10_8 },
- - { .offset = (uintptr_t)&mode4_svga_864x656_29_88fps },
- - { .offset = (uintptr_t)&mode5_vga_648x492_29_93fps },
- - { .offset = (uintptr_t)&mode2_16vga_2592x1968_3_99fps },
- - { .offset = (uintptr_t)&mode_648x492_5fps },
- - { .offset = (uintptr_t)&mode3_4vga_1296x984_5fps },
- - { .offset = (uintptr_t)&mode_4vga_1296x984_25fps_dpcm10_8 },
- - { .offset = 0 }
- + { .ptr = &mode1_poweron_mode2_16vga_2592x1968_12_07fps },
- + { .ptr = &mode1_16vga_2592x1968_13_12fps_dpcm10_8 },
- + { .ptr = &mode3_4vga_1296x984_29_99fps_dpcm10_8 },
- + { .ptr = &mode4_svga_864x656_29_88fps },
- + { .ptr = &mode5_vga_648x492_29_93fps },
- + { .ptr = &mode2_16vga_2592x1968_3_99fps },
- + { .ptr = &mode_648x492_5fps },
- + { .ptr = &mode3_4vga_1296x984_5fps },
- + { .ptr = &mode_4vga_1296x984_25fps_dpcm10_8 },
- + { .ptr = 0 }
- }
- };
- diff --git a/drivers/media/i2c/smia/smiaregs.c b/drivers/media/i2c/smia/smiaregs.c
- index a681e65..f88ac38 100644
- --- a/drivers/media/i2c/smia/smiaregs.c
- +++ b/drivers/media/i2c/smia/smiaregs.c
- @@ -217,8 +217,6 @@ static int smia_reglist_cmp(const void *a, const void *b)
- /*
- * Prepare register list created by dcc-pulautin for use in kernel.
- - * The pointers in the list are actually offsets from the beginning of
- - * the blob.
- */
- int smia_reglist_import(struct smia_meta_reglist *meta)
- {
- @@ -233,25 +231,17 @@ int smia_reglist_import(struct smia_meta_reglist *meta)
- printk(KERN_ALERT "%s: meta_reglist version %s\n",
- __func__, meta->version);
- - while (meta->reglist[nlists].offset != 0) {
- - struct smia_reglist *list;
- -
- - meta->reglist[nlists].offset =
- - (uintptr_t)meta + meta->reglist[nlists].offset;
- -
- - list = meta->reglist[nlists].ptr;
- -
- + while (meta->reglist[nlists].ptr != NULL)
- nlists++;
- - }
- if (!nlists)
- return -EINVAL;
- - sort(&meta->reglist[0].offset, nlists, sizeof(meta->reglist[0].offset),
- + sort(&meta->reglist[0].ptr, nlists, sizeof(meta->reglist[0].ptr),
- smia_reglist_cmp, NULL);
- nlists = 0;
- - while (meta->reglist[nlists].offset != 0) {
- + while (meta->reglist[nlists].ptr != NULL) {
- struct smia_reglist *list;
- list = meta->reglist[nlists].ptr;
- @@ -264,7 +254,7 @@ int smia_reglist_import(struct smia_meta_reglist *meta)
- list->mode.pixel_format,
- list->mode.timeperframe.numerator,
- list->mode.timeperframe.denominator,
- - (void *)meta->reglist[nlists].offset);
- + (void *)meta->reglist[nlists].ptr);
- nlists++;
- }
- diff --git a/include/media/smiaregs.h b/include/media/smiaregs.h
- index caade3d..8d7e79d 100644
- --- a/include/media/smiaregs.h
- +++ b/include/media/smiaregs.h
- @@ -97,19 +97,7 @@ struct smia_reglist {
- struct smia_meta_reglist {
- u32 magic;
- char version[SMIA_MAX_LEN];
- - /*
- - * When we generate a reglist, the objcopy program will put
- - * here the list of addresses to reglists local to that object
- - * file.
- - *
- - * In the kernel they serve as offsets inside the the register
- - * list binary.
- - *
- - * The list must be NULL-terminated. That is expected by the
- - * drivers.
- - */
- union {
- - uintptr_t offset;
- struct smia_reglist *ptr;
- } reglist[];
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement