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