Dan Carpenter
2017-Jan-10 20:22 UTC
[Nouveau] [bug report] drm/nouveau/devinit: move simple pll setting routines to devinit
Hello Ben Skeggs, The patch 88524bc06926: "drm/nouveau/devinit: move simple pll setting routines to devinit" from Mar 5, 2013, leads to the following static checker warning: drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c:53 nv50_devinit_pll_set() info: return a literal instead of 'ret' drivers/gpu/drm/nouveau/nvkm/subdev/devinit/nv50.c 34 int 35 nv50_devinit_pll_set(struct nvkm_devinit *init, u32 type, u32 freq) 36 { 37 struct nvkm_subdev *subdev = &init->subdev; 38 struct nvkm_device *device = subdev->device; 39 struct nvkm_bios *bios = device->bios; 40 struct nvbios_pll info; 41 int N1, M1, N2, M2, P; 42 int ret; 43 44 ret = nvbios_pll_parse(bios, type, &info); 45 if (ret) { 46 nvkm_error(subdev, "failed to retrieve pll data, %d\n", ret); 47 return ret; 48 } 49 50 ret = nv04_pll_calc(subdev, &info, freq, &N1, &M1, &N2, &M2, &P); 51 if (!ret) { 52 nvkm_error(subdev, "failed pll calculation\n"); 53 return ret; This should probably be a negative error code instead of "ret"? 54 } 55 56 switch (info.type) { 57 case PLL_VPLL0: 58 case PLL_VPLL1: 59 nvkm_wr32(device, info.reg + 0, 0x10000611); 60 nvkm_mask(device, info.reg + 4, 0x00ff00ff, (M1 << 16) | N1); 61 nvkm_mask(device, info.reg + 8, 0x7fff00ff, (P << 28) | 62 (M2 << 16) | N2); 63 break; 64 case PLL_MEMORY: 65 nvkm_mask(device, info.reg + 0, 0x01ff0000, 66 (P << 22) | 67 (info.bias_p << 19) | 68 (P << 16)); 69 nvkm_wr32(device, info.reg + 4, (N1 << 8) | M1); 70 break; 71 default: 72 nvkm_mask(device, info.reg + 0, 0x00070000, (P << 16)); 73 nvkm_wr32(device, info.reg + 4, (N1 << 8) | M1); 74 break; 75 } 76 77 return 0; 78 } regards, dan carpenter
Seemingly Similar Threads
- [PATCH] drm/nouveau/clock: fix support for more than 2 monitors on nve0
- [PATCH] drm/nouveau: remove redundant check
- [PATCH 1/3] nvkm/clk/gf100+: Clean up PLL locking test
- [PATCH v2 1/2] nvkm/clk/gf100+: Clean up PLL locking test
- [PATCH 1/3] drm/nouveau: provide a way for devinit to mark engines as disabled