Skip to content

Commit fc2d10d

Browse files
Jean Delvaretorvalds
authored andcommitted
matroxfb: get rid of unneeded macros ACCESS_FBINFO and MINFO
With multihead support always enabled, these macros are no longer needed and make the code harder to read. Signed-off-by: Jean Delvare <khali@linux-fr.org> Acked-by: Petr Vandrovec <vandrove@vc.cvut.cz> Cc: Krzysztof Helt <krzysztof.h1@poczta.fm> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 0728bac commit fc2d10d

12 files changed

Lines changed: 837 additions & 842 deletions

‎drivers/video/matrox/g450_pll.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ static unsigned int g450_mnp2vco(CPMINFO unsigned int mnp) {
3030

3131
m = ((mnp >> 16) & 0x0FF) + 1;
3232
n = ((mnp >> 7) & 0x1FE) + 4;
33-
return (ACCESS_FBINFO(features).pll.ref_freq * n + (m >> 1)) / m;
33+
return (minfo->features.pll.ref_freq * n + (m >> 1)) / m;
3434
}
3535

3636
unsigned int g450_mnp2f(CPMINFO unsigned int mnp) {
@@ -90,7 +90,7 @@ static unsigned int g450_nextpll(CPMINFO const struct matrox_pll_limits* pi, uns
9090
} else {
9191
m--;
9292
}
93-
n = ((tvco * (m+1) + ACCESS_FBINFO(features).pll.ref_freq) / (ACCESS_FBINFO(features).pll.ref_freq * 2)) - 2;
93+
n = ((tvco * (m+1) + minfo->features.pll.ref_freq) / (minfo->features.pll.ref_freq * 2)) - 2;
9494
} while (n < 0x03 || n > 0x7A);
9595
return (m << 16) | (n << 8) | p;
9696
}
@@ -333,7 +333,7 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
333333
matroxfb_DAC_out(PMINFO M1064_XPIXCLKCTRL, tmp);
334334
/* DVI PLL preferred for frequencies up to
335335
panel link max, standard PLL otherwise */
336-
if (fout >= MINFO->max_pixel_clock_panellink)
336+
if (fout >= minfo->max_pixel_clock_panellink)
337337
tmp = 0;
338338
else tmp =
339339
M1064_XDVICLKCTRL_DVIDATAPATHSEL |
@@ -363,20 +363,20 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
363363
}
364364
mga_outb(M_MISC_REG, misc);
365365
}
366-
pi = &ACCESS_FBINFO(limits.pixel);
367-
ci = &ACCESS_FBINFO(cache.pixel);
366+
pi = &minfo->limits.pixel;
367+
ci = &minfo->cache.pixel;
368368
break;
369369
case M_SYSTEM_PLL:
370370
{
371371
u_int32_t opt;
372372

373-
pci_read_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, &opt);
373+
pci_read_config_dword(minfo->pcidev, PCI_OPTION_REG, &opt);
374374
if (!(opt & 0x20)) {
375-
pci_write_config_dword(ACCESS_FBINFO(pcidev), PCI_OPTION_REG, opt | 0x20);
375+
pci_write_config_dword(minfo->pcidev, PCI_OPTION_REG, opt | 0x20);
376376
}
377377
}
378-
pi = &ACCESS_FBINFO(limits.system);
379-
ci = &ACCESS_FBINFO(cache.system);
378+
pi = &minfo->limits.system;
379+
ci = &minfo->cache.system;
380380
break;
381381
case M_VIDEO_PLL:
382382
{
@@ -395,8 +395,8 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
395395
pixel_vco = g450_mnp2vco(PMINFO mnp);
396396
matroxfb_DAC_unlock_irqrestore(flags);
397397
}
398-
pi = &ACCESS_FBINFO(limits.video);
399-
ci = &ACCESS_FBINFO(cache.video);
398+
pi = &minfo->limits.video;
399+
ci = &minfo->cache.video;
400400
break;
401401
default:
402402
return -EINVAL;
@@ -475,7 +475,7 @@ static int __g450_setclk(WPMINFO unsigned int fout, unsigned int pll,
475475
mnp = g450_findworkingpll(PMINFO pll, mnparray, mnpcount);
476476
g450_addcache(ci, mnparray[0], mnp);
477477
}
478-
updatehwstate_clk(&ACCESS_FBINFO(hw), mnp, pll);
478+
updatehwstate_clk(&minfo->hw, mnp, pll);
479479
matroxfb_DAC_unlock_irqrestore(flags);
480480
return mnp;
481481
}

‎drivers/video/matrox/i2c-matroxfb.c‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ static int i2c_bus_reg(struct i2c_bit_adapter* b, struct matrox_fb_info* minfo,
112112
i2c_set_adapdata(&b->adapter, b);
113113
b->adapter.class = class;
114114
b->adapter.algo_data = &b->bac;
115-
b->adapter.dev.parent = &ACCESS_FBINFO(pcidev)->dev;
115+
b->adapter.dev.parent = &minfo->pcidev->dev;
116116
b->bac = matrox_i2c_algo_template;
117117
b->bac.data = b;
118118
err = i2c_bit_add_bus(&b->adapter);
@@ -153,7 +153,7 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) {
153153
matroxfb_DAC_out(PMINFO DAC_XGENIOCTRL, 0x00);
154154
matroxfb_DAC_unlock_irqrestore(flags);
155155

156-
switch (ACCESS_FBINFO(chip)) {
156+
switch (minfo->chip) {
157157
case MGA_2064:
158158
case MGA_2164:
159159
err = i2c_bus_reg(&m2info->ddc1, minfo,
@@ -168,7 +168,7 @@ static void* i2c_matroxfb_probe(struct matrox_fb_info* minfo) {
168168
}
169169
if (err)
170170
goto fail_ddc1;
171-
if (ACCESS_FBINFO(devflags.dualhead)) {
171+
if (minfo->devflags.dualhead) {
172172
err = i2c_bus_reg(&m2info->ddc2, minfo,
173173
DDC2_DATA, DDC2_CLK,
174174
"DDC:fb%u #1", I2C_CLASS_DDC);

0 commit comments

Comments
 (0)