diff options
author | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-03-28 21:24:50 -0500 |
commit | bac30d1a78d0f11c613968fc8b351a91ed465386 (patch) | |
tree | e52f3c876522a2f6047a6ec1c27df2e8a79486b8 /drivers/video/aty | |
parent | e8222502ee6157e2713da9e0792c21f4ad458d50 (diff) | |
parent | ca9ba4471c1203bb6e759b76e83167fec54fe590 (diff) |
Merge ../linux-2.6
Diffstat (limited to 'drivers/video/aty')
-rw-r--r-- | drivers/video/aty/aty128fb.c | 4 | ||||
-rw-r--r-- | drivers/video/aty/atyfb_base.c | 16 | ||||
-rw-r--r-- | drivers/video/aty/mach64_gx.c | 3 | ||||
-rw-r--r-- | drivers/video/aty/radeon_base.c | 6 |
4 files changed, 15 insertions, 14 deletions
diff --git a/drivers/video/aty/aty128fb.c b/drivers/video/aty/aty128fb.c index f07be22e119d..f7bbff4ddc6a 100644 --- a/drivers/video/aty/aty128fb.c +++ b/drivers/video/aty/aty128fb.c | |||
@@ -1726,9 +1726,9 @@ static int __init aty128_init(struct pci_dev *pdev, const struct pci_device_id * | |||
1726 | strcpy(video_card, "Rage128 XX "); | 1726 | strcpy(video_card, "Rage128 XX "); |
1727 | video_card[8] = ent->device >> 8; | 1727 | video_card[8] = ent->device >> 8; |
1728 | video_card[9] = ent->device & 0xFF; | 1728 | video_card[9] = ent->device & 0xFF; |
1729 | 1729 | ||
1730 | /* range check to make sure */ | 1730 | /* range check to make sure */ |
1731 | if (ent->driver_data < (sizeof(r128_family)/sizeof(char *))) | 1731 | if (ent->driver_data < ARRAY_SIZE(r128_family)) |
1732 | strncat(video_card, r128_family[ent->driver_data], sizeof(video_card)); | 1732 | strncat(video_card, r128_family[ent->driver_data], sizeof(video_card)); |
1733 | 1733 | ||
1734 | printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev); | 1734 | printk(KERN_INFO "aty128fb: %s [chip rev 0x%x] ", video_card, chip_rev); |
diff --git a/drivers/video/aty/atyfb_base.c b/drivers/video/aty/atyfb_base.c index 1b1f24e2bfbe..b39e72d5413b 100644 --- a/drivers/video/aty/atyfb_base.c +++ b/drivers/video/aty/atyfb_base.c | |||
@@ -435,7 +435,7 @@ static int __devinit correct_chipset(struct atyfb_par *par) | |||
435 | const char *name; | 435 | const char *name; |
436 | int i; | 436 | int i; |
437 | 437 | ||
438 | for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--) | 438 | for (i = ARRAY_SIZE(aty_chips) - 1; i >= 0; i--) |
439 | if (par->pci_id == aty_chips[i].pci_id) | 439 | if (par->pci_id == aty_chips[i].pci_id) |
440 | break; | 440 | break; |
441 | 441 | ||
@@ -2169,10 +2169,10 @@ static void __init aty_calc_mem_refresh(struct atyfb_par *par, int xclk) | |||
2169 | 2169 | ||
2170 | if (IS_XL(par->pci_id) || IS_MOBILITY(par->pci_id)) { | 2170 | if (IS_XL(par->pci_id) || IS_MOBILITY(par->pci_id)) { |
2171 | refresh_tbl = ragexl_tbl; | 2171 | refresh_tbl = ragexl_tbl; |
2172 | size = sizeof(ragexl_tbl)/sizeof(int); | 2172 | size = ARRAY_SIZE(ragexl_tbl); |
2173 | } else { | 2173 | } else { |
2174 | refresh_tbl = ragepro_tbl; | 2174 | refresh_tbl = ragepro_tbl; |
2175 | size = sizeof(ragepro_tbl)/sizeof(int); | 2175 | size = ARRAY_SIZE(ragepro_tbl); |
2176 | } | 2176 | } |
2177 | 2177 | ||
2178 | for (i=0; i < size; i++) { | 2178 | for (i=0; i < size; i++) { |
@@ -2299,6 +2299,10 @@ static int __init aty_init(struct fb_info *info, const char *name) | |||
2299 | case CLK_ATI18818_1: | 2299 | case CLK_ATI18818_1: |
2300 | par->pll_ops = &aty_pll_ati18818_1; | 2300 | par->pll_ops = &aty_pll_ati18818_1; |
2301 | break; | 2301 | break; |
2302 | case CLK_IBMRGB514: | ||
2303 | par->pll_ops = &aty_pll_ibm514; | ||
2304 | break; | ||
2305 | #if 0 /* dead code */ | ||
2302 | case CLK_STG1703: | 2306 | case CLK_STG1703: |
2303 | par->pll_ops = &aty_pll_stg1703; | 2307 | par->pll_ops = &aty_pll_stg1703; |
2304 | break; | 2308 | break; |
@@ -2308,9 +2312,7 @@ static int __init aty_init(struct fb_info *info, const char *name) | |||
2308 | case CLK_ATT20C408: | 2312 | case CLK_ATT20C408: |
2309 | par->pll_ops = &aty_pll_att20c408; | 2313 | par->pll_ops = &aty_pll_att20c408; |
2310 | break; | 2314 | break; |
2311 | case CLK_IBMRGB514: | 2315 | #endif |
2312 | par->pll_ops = &aty_pll_ibm514; | ||
2313 | break; | ||
2314 | default: | 2316 | default: |
2315 | PRINTKI("aty_init: CLK type not implemented yet!"); | 2317 | PRINTKI("aty_init: CLK type not implemented yet!"); |
2316 | par->pll_ops = &aty_pll_unsupported; | 2318 | par->pll_ops = &aty_pll_unsupported; |
@@ -3398,7 +3400,7 @@ static int __devinit atyfb_pci_probe(struct pci_dev *pdev, const struct pci_devi | |||
3398 | struct atyfb_par *par; | 3400 | struct atyfb_par *par; |
3399 | int i, rc = -ENOMEM; | 3401 | int i, rc = -ENOMEM; |
3400 | 3402 | ||
3401 | for (i = sizeof(aty_chips) / sizeof(*aty_chips) - 1; i >= 0; i--) | 3403 | for (i = ARRAY_SIZE(aty_chips); i >= 0; i--) |
3402 | if (pdev->device == aty_chips[i].pci_id) | 3404 | if (pdev->device == aty_chips[i].pci_id) |
3403 | break; | 3405 | break; |
3404 | 3406 | ||
diff --git a/drivers/video/aty/mach64_gx.c b/drivers/video/aty/mach64_gx.c index 01fdff79483b..2045639cb671 100644 --- a/drivers/video/aty/mach64_gx.c +++ b/drivers/video/aty/mach64_gx.c | |||
@@ -149,8 +149,7 @@ static int aty_var_to_pll_514(const struct fb_info *info, u32 vclk_per, | |||
149 | }; | 149 | }; |
150 | int i; | 150 | int i; |
151 | 151 | ||
152 | for (i = 0; i < sizeof(RGB514_clocks) / sizeof(*RGB514_clocks); | 152 | for (i = 0; i < ARRAY_SIZE(RGB514_clocks); i++) |
153 | i++) | ||
154 | if (vclk_per <= RGB514_clocks[i].limit) { | 153 | if (vclk_per <= RGB514_clocks[i].limit) { |
155 | pll->ibm514.m = RGB514_clocks[i].m; | 154 | pll->ibm514.m = RGB514_clocks[i].m; |
156 | pll->ibm514.n = RGB514_clocks[i].n; | 155 | pll->ibm514.n = RGB514_clocks[i].n; |
diff --git a/drivers/video/aty/radeon_base.c b/drivers/video/aty/radeon_base.c index c9f0c5a07e6e..9a6b5b39b88e 100644 --- a/drivers/video/aty/radeon_base.c +++ b/drivers/video/aty/radeon_base.c | |||
@@ -1067,7 +1067,7 @@ static int radeon_setcolreg (unsigned regno, unsigned red, unsigned green, | |||
1067 | 1067 | ||
1068 | 1068 | ||
1069 | if (regno > 255) | 1069 | if (regno > 255) |
1070 | return 1; | 1070 | return -EINVAL; |
1071 | 1071 | ||
1072 | red >>= 8; | 1072 | red >>= 8; |
1073 | green >>= 8; | 1073 | green >>= 8; |
@@ -1086,9 +1086,9 @@ static int radeon_setcolreg (unsigned regno, unsigned red, unsigned green, | |||
1086 | pindex = regno * 8; | 1086 | pindex = regno * 8; |
1087 | 1087 | ||
1088 | if (rinfo->depth == 16 && regno > 63) | 1088 | if (rinfo->depth == 16 && regno > 63) |
1089 | return 1; | 1089 | return -EINVAL; |
1090 | if (rinfo->depth == 15 && regno > 31) | 1090 | if (rinfo->depth == 15 && regno > 31) |
1091 | return 1; | 1091 | return -EINVAL; |
1092 | 1092 | ||
1093 | /* For 565, the green component is mixed one order | 1093 | /* For 565, the green component is mixed one order |
1094 | * below | 1094 | * below |