Merge branch 'sh/for-2.6.34' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6

* 'sh/for-2.6.34' of git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6:
sh: fix a number of Oopses and leaks in SH framebuffer driver
SH: fix error paths in DMA driver
sh: sh7751 pci controller io port fix
sh: Fix maximum number of SCIF ports in R2D defconfigs
SH: fix TS field shift calculation for DMA drivers

+40 -25
+1 -1
arch/sh/configs/rts7751r2d1_defconfig
··· 877 877 # 878 878 # CONFIG_SERIAL_MAX3100 is not set 879 879 CONFIG_SERIAL_SH_SCI=y 880 - CONFIG_SERIAL_SH_SCI_NR_UARTS=1 880 + CONFIG_SERIAL_SH_SCI_NR_UARTS=2 881 881 CONFIG_SERIAL_SH_SCI_CONSOLE=y 882 882 CONFIG_SERIAL_CORE=y 883 883 CONFIG_SERIAL_CORE_CONSOLE=y
+1 -1
arch/sh/configs/rts7751r2dplus_defconfig
··· 963 963 # 964 964 # CONFIG_SERIAL_MAX3100 is not set 965 965 CONFIG_SERIAL_SH_SCI=y 966 - CONFIG_SERIAL_SH_SCI_NR_UARTS=1 966 + CONFIG_SERIAL_SH_SCI_NR_UARTS=2 967 967 CONFIG_SERIAL_SH_SCI_CONSOLE=y 968 968 CONFIG_SERIAL_CORE=y 969 969 CONFIG_SERIAL_CORE_CONSOLE=y
+3 -2
arch/sh/drivers/pci/pci-sh7751.c
··· 17 17 #include <linux/io.h> 18 18 #include "pci-sh4.h" 19 19 #include <asm/addrspace.h> 20 + #include <asm/sizes.h> 20 21 21 22 static int __init __area_sdram_check(struct pci_channel *chan, 22 23 unsigned int area) ··· 48 47 static struct resource sh7751_pci_resources[] = { 49 48 { 50 49 .name = "SH7751_IO", 51 - .start = SH7751_PCI_IO_BASE, 52 - .end = SH7751_PCI_IO_BASE + SH7751_PCI_IO_SIZE - 1, 50 + .start = 0x1000, 51 + .end = SZ_4M - 1, 53 52 .flags = IORESOURCE_IO 54 53 }, { 55 54 .name = "SH7751_mem",
+1 -1
arch/sh/include/cpu-sh4/cpu/dma-register.h
··· 76 76 } 77 77 78 78 #define TS_INDEX2VAL(i) ((((i) & 3) << CHCR_TS_LOW_SHIFT) | \ 79 - ((((i) >> 2) & 3) << CHCR_TS_HIGH_SHIFT)) 79 + (((i) & 0xc) << CHCR_TS_HIGH_SHIFT)) 80 80 81 81 #else /* CONFIG_CPU_SH4A */ 82 82
+21 -6
drivers/dma/shdma.c
··· 290 290 struct sh_dmae_chan *sh_chan = to_sh_chan(chan); 291 291 struct sh_desc *desc; 292 292 struct sh_dmae_slave *param = chan->private; 293 + int ret; 293 294 294 295 pm_runtime_get_sync(sh_chan->dev); 295 296 ··· 302 301 struct sh_dmae_slave_config *cfg; 303 302 304 303 cfg = sh_dmae_find_slave(sh_chan, param->slave_id); 305 - if (!cfg) 306 - return -EINVAL; 304 + if (!cfg) { 305 + ret = -EINVAL; 306 + goto efindslave; 307 + } 307 308 308 - if (test_and_set_bit(param->slave_id, sh_dmae_slave_used)) 309 - return -EBUSY; 309 + if (test_and_set_bit(param->slave_id, sh_dmae_slave_used)) { 310 + ret = -EBUSY; 311 + goto etestused; 312 + } 310 313 311 314 param->config = cfg; 312 315 ··· 339 334 } 340 335 spin_unlock_bh(&sh_chan->desc_lock); 341 336 342 - if (!sh_chan->descs_allocated) 343 - pm_runtime_put(sh_chan->dev); 337 + if (!sh_chan->descs_allocated) { 338 + ret = -ENOMEM; 339 + goto edescalloc; 340 + } 344 341 345 342 return sh_chan->descs_allocated; 343 + 344 + edescalloc: 345 + if (param) 346 + clear_bit(param->slave_id, sh_dmae_slave_used); 347 + etestused: 348 + efindslave: 349 + pm_runtime_put(sh_chan->dev); 350 + return ret; 346 351 } 347 352 348 353 /*
+13 -14
drivers/video/sh_mobile_lcdcfb.c
··· 695 695 * 1) Enable Runtime PM 696 696 * 2) Force Runtime PM Resume since hardware is accessed from probe() 697 697 */ 698 + priv->dev = &pdev->dev; 698 699 pm_runtime_enable(priv->dev); 699 700 pm_runtime_resume(priv->dev); 700 701 return 0; ··· 958 957 959 958 if (!pdev->dev.platform_data) { 960 959 dev_err(&pdev->dev, "no platform data defined\n"); 961 - error = -EINVAL; 962 - goto err0; 960 + return -EINVAL; 963 961 } 964 962 965 963 res = platform_get_resource(pdev, IORESOURCE_MEM, 0); 966 964 i = platform_get_irq(pdev, 0); 967 965 if (!res || i < 0) { 968 966 dev_err(&pdev->dev, "cannot get platform resources\n"); 969 - error = -ENOENT; 970 - goto err0; 967 + return -ENOENT; 971 968 } 972 969 973 970 priv = kzalloc(sizeof(*priv), GFP_KERNEL); 974 971 if (!priv) { 975 972 dev_err(&pdev->dev, "cannot allocate device data\n"); 976 - error = -ENOMEM; 977 - goto err0; 973 + return -ENOMEM; 978 974 } 975 + 976 + platform_set_drvdata(pdev, priv); 979 977 980 978 error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED, 981 979 dev_name(&pdev->dev), priv); ··· 984 984 } 985 985 986 986 priv->irq = i; 987 - priv->dev = &pdev->dev; 988 - platform_set_drvdata(pdev, priv); 989 987 pdata = pdev->dev.platform_data; 990 988 991 989 j = 0; ··· 1097 1099 info = ch->info; 1098 1100 1099 1101 if (info->fbdefio) { 1100 - priv->ch->sglist = vmalloc(sizeof(struct scatterlist) * 1102 + ch->sglist = vmalloc(sizeof(struct scatterlist) * 1101 1103 info->fix.smem_len >> PAGE_SHIFT); 1102 - if (!priv->ch->sglist) { 1104 + if (!ch->sglist) { 1103 1105 dev_err(&pdev->dev, "cannot allocate sglist\n"); 1104 1106 goto err1; 1105 1107 } ··· 1124 1126 } 1125 1127 1126 1128 return 0; 1127 - err1: 1129 + err1: 1128 1130 sh_mobile_lcdc_remove(pdev); 1129 - err0: 1131 + 1130 1132 return error; 1131 1133 } 1132 1134 ··· 1137 1139 int i; 1138 1140 1139 1141 for (i = 0; i < ARRAY_SIZE(priv->ch); i++) 1140 - if (priv->ch[i].info->dev) 1142 + if (priv->ch[i].info && priv->ch[i].info->dev) 1141 1143 unregister_framebuffer(priv->ch[i].info); 1142 1144 1143 1145 sh_mobile_lcdc_stop(priv); ··· 1160 1162 if (priv->dot_clk) 1161 1163 clk_put(priv->dot_clk); 1162 1164 1163 - pm_runtime_disable(priv->dev); 1165 + if (priv->dev) 1166 + pm_runtime_disable(priv->dev); 1164 1167 1165 1168 if (priv->base) 1166 1169 iounmap(priv->base);