diff options
author | David Woodhouse <David.Woodhouse@intel.com> | 2010-05-10 09:32:46 -0400 |
---|---|---|
committer | David Woodhouse <David.Woodhouse@intel.com> | 2010-05-10 09:32:46 -0400 |
commit | 0ae28a35bcb7984838acbf28bfba9c030f8b74f0 (patch) | |
tree | 4f449d929b5df9e126e839f388ff0fd2b52028a0 /drivers/video/sh_mobile_lcdcfb.c | |
parent | 6f1f3d0ab5c3eeea9f04486481c25e9afdfa26c5 (diff) | |
parent | b57f95a38233a2e73b679bea4a5453a1cc2a1cc9 (diff) |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6
Conflicts:
drivers/mtd/mtdcore.c
Pull in the bdi fixes and ARM platform changes that other outstanding
patches depend on.
Diffstat (limited to 'drivers/video/sh_mobile_lcdcfb.c')
-rw-r--r-- | drivers/video/sh_mobile_lcdcfb.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/drivers/video/sh_mobile_lcdcfb.c b/drivers/video/sh_mobile_lcdcfb.c index bbd1dbf4026a..e8c769944812 100644 --- a/drivers/video/sh_mobile_lcdcfb.c +++ b/drivers/video/sh_mobile_lcdcfb.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/interrupt.h> | 20 | #include <linux/interrupt.h> |
21 | #include <linux/vmalloc.h> | 21 | #include <linux/vmalloc.h> |
22 | #include <linux/ioctl.h> | 22 | #include <linux/ioctl.h> |
23 | #include <linux/slab.h> | ||
23 | #include <video/sh_mobile_lcdc.h> | 24 | #include <video/sh_mobile_lcdc.h> |
24 | #include <asm/atomic.h> | 25 | #include <asm/atomic.h> |
25 | 26 | ||
@@ -694,6 +695,7 @@ static int sh_mobile_lcdc_setup_clocks(struct platform_device *pdev, | |||
694 | * 1) Enable Runtime PM | 695 | * 1) Enable Runtime PM |
695 | * 2) Force Runtime PM Resume since hardware is accessed from probe() | 696 | * 2) Force Runtime PM Resume since hardware is accessed from probe() |
696 | */ | 697 | */ |
698 | priv->dev = &pdev->dev; | ||
697 | pm_runtime_enable(priv->dev); | 699 | pm_runtime_enable(priv->dev); |
698 | pm_runtime_resume(priv->dev); | 700 | pm_runtime_resume(priv->dev); |
699 | return 0; | 701 | return 0; |
@@ -956,25 +958,24 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
956 | 958 | ||
957 | if (!pdev->dev.platform_data) { | 959 | if (!pdev->dev.platform_data) { |
958 | dev_err(&pdev->dev, "no platform data defined\n"); | 960 | dev_err(&pdev->dev, "no platform data defined\n"); |
959 | error = -EINVAL; | 961 | return -EINVAL; |
960 | goto err0; | ||
961 | } | 962 | } |
962 | 963 | ||
963 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 964 | res = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
964 | i = platform_get_irq(pdev, 0); | 965 | i = platform_get_irq(pdev, 0); |
965 | if (!res || i < 0) { | 966 | if (!res || i < 0) { |
966 | dev_err(&pdev->dev, "cannot get platform resources\n"); | 967 | dev_err(&pdev->dev, "cannot get platform resources\n"); |
967 | error = -ENOENT; | 968 | return -ENOENT; |
968 | goto err0; | ||
969 | } | 969 | } |
970 | 970 | ||
971 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); | 971 | priv = kzalloc(sizeof(*priv), GFP_KERNEL); |
972 | if (!priv) { | 972 | if (!priv) { |
973 | dev_err(&pdev->dev, "cannot allocate device data\n"); | 973 | dev_err(&pdev->dev, "cannot allocate device data\n"); |
974 | error = -ENOMEM; | 974 | return -ENOMEM; |
975 | goto err0; | ||
976 | } | 975 | } |
977 | 976 | ||
977 | platform_set_drvdata(pdev, priv); | ||
978 | |||
978 | error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED, | 979 | error = request_irq(i, sh_mobile_lcdc_irq, IRQF_DISABLED, |
979 | dev_name(&pdev->dev), priv); | 980 | dev_name(&pdev->dev), priv); |
980 | if (error) { | 981 | if (error) { |
@@ -983,8 +984,6 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
983 | } | 984 | } |
984 | 985 | ||
985 | priv->irq = i; | 986 | priv->irq = i; |
986 | priv->dev = &pdev->dev; | ||
987 | platform_set_drvdata(pdev, priv); | ||
988 | pdata = pdev->dev.platform_data; | 987 | pdata = pdev->dev.platform_data; |
989 | 988 | ||
990 | j = 0; | 989 | j = 0; |
@@ -1098,9 +1097,9 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
1098 | info = ch->info; | 1097 | info = ch->info; |
1099 | 1098 | ||
1100 | if (info->fbdefio) { | 1099 | if (info->fbdefio) { |
1101 | priv->ch->sglist = vmalloc(sizeof(struct scatterlist) * | 1100 | ch->sglist = vmalloc(sizeof(struct scatterlist) * |
1102 | info->fix.smem_len >> PAGE_SHIFT); | 1101 | info->fix.smem_len >> PAGE_SHIFT); |
1103 | if (!priv->ch->sglist) { | 1102 | if (!ch->sglist) { |
1104 | dev_err(&pdev->dev, "cannot allocate sglist\n"); | 1103 | dev_err(&pdev->dev, "cannot allocate sglist\n"); |
1105 | goto err1; | 1104 | goto err1; |
1106 | } | 1105 | } |
@@ -1125,9 +1124,9 @@ static int __devinit sh_mobile_lcdc_probe(struct platform_device *pdev) | |||
1125 | } | 1124 | } |
1126 | 1125 | ||
1127 | return 0; | 1126 | return 0; |
1128 | err1: | 1127 | err1: |
1129 | sh_mobile_lcdc_remove(pdev); | 1128 | sh_mobile_lcdc_remove(pdev); |
1130 | err0: | 1129 | |
1131 | return error; | 1130 | return error; |
1132 | } | 1131 | } |
1133 | 1132 | ||
@@ -1138,7 +1137,7 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
1138 | int i; | 1137 | int i; |
1139 | 1138 | ||
1140 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) | 1139 | for (i = 0; i < ARRAY_SIZE(priv->ch); i++) |
1141 | if (priv->ch[i].info->dev) | 1140 | if (priv->ch[i].info && priv->ch[i].info->dev) |
1142 | unregister_framebuffer(priv->ch[i].info); | 1141 | unregister_framebuffer(priv->ch[i].info); |
1143 | 1142 | ||
1144 | sh_mobile_lcdc_stop(priv); | 1143 | sh_mobile_lcdc_stop(priv); |
@@ -1161,7 +1160,8 @@ static int sh_mobile_lcdc_remove(struct platform_device *pdev) | |||
1161 | if (priv->dot_clk) | 1160 | if (priv->dot_clk) |
1162 | clk_put(priv->dot_clk); | 1161 | clk_put(priv->dot_clk); |
1163 | 1162 | ||
1164 | pm_runtime_disable(priv->dev); | 1163 | if (priv->dev) |
1164 | pm_runtime_disable(priv->dev); | ||
1165 | 1165 | ||
1166 | if (priv->base) | 1166 | if (priv->base) |
1167 | iounmap(priv->base); | 1167 | iounmap(priv->base); |