aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/mfd/htc-pasic3.c9
-rw-r--r--drivers/mmc/host/mmci.c4
-rw-r--r--drivers/net/arm/am79c961a.c10
-rw-r--r--drivers/serial/s3c2410.c7
4 files changed, 20 insertions, 10 deletions
diff --git a/drivers/mfd/htc-pasic3.c b/drivers/mfd/htc-pasic3.c
index 4edc120a6359..633cbba072f0 100644
--- a/drivers/mfd/htc-pasic3.c
+++ b/drivers/mfd/htc-pasic3.c
@@ -132,8 +132,9 @@ static struct ds1wm_platform_data ds1wm_pdata = {
132 .disable = ds1wm_disable, 132 .disable = ds1wm_disable,
133}; 133};
134 134
135static int ds1wm_device_add(struct device *pasic3_dev, int bus_shift) 135static int ds1wm_device_add(struct platform_device *pasic3_pdev, int bus_shift)
136{ 136{
137 struct device *pasic3_dev = &pasic3_pdev->dev;
137 struct pasic3_data *asic = pasic3_dev->driver_data; 138 struct pasic3_data *asic = pasic3_dev->driver_data;
138 struct platform_device *pdev; 139 struct platform_device *pdev;
139 int ret; 140 int ret;
@@ -144,8 +145,8 @@ static int ds1wm_device_add(struct device *pasic3_dev, int bus_shift)
144 return -ENOMEM; 145 return -ENOMEM;
145 } 146 }
146 147
147 ret = platform_device_add_resources(pdev, pdev->resource, 148 ret = platform_device_add_resources(pdev, pasic3_pdev->resource,
148 pdev->num_resources); 149 pasic3_pdev->num_resources);
149 if (ret < 0) { 150 if (ret < 0) {
150 dev_dbg(pasic3_dev, "failed to add DS1WM resources\n"); 151 dev_dbg(pasic3_dev, "failed to add DS1WM resources\n");
151 goto exit_pdev_put; 152 goto exit_pdev_put;
@@ -207,7 +208,7 @@ static int __init pasic3_probe(struct platform_device *pdev)
207 return -ENOMEM; 208 return -ENOMEM;
208 } 209 }
209 210
210 ret = ds1wm_device_add(dev, asic->bus_shift); 211 ret = ds1wm_device_add(pdev, asic->bus_shift);
211 if (ret < 0) 212 if (ret < 0)
212 dev_warn(dev, "failed to register DS1WM\n"); 213 dev_warn(dev, "failed to register DS1WM\n");
213 214
diff --git a/drivers/mmc/host/mmci.c b/drivers/mmc/host/mmci.c
index 95244a7e7353..626ac083f4e0 100644
--- a/drivers/mmc/host/mmci.c
+++ b/drivers/mmc/host/mmci.c
@@ -213,9 +213,10 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
213 void __iomem *base = host->base; 213 void __iomem *base = host->base;
214 char *ptr = buffer; 214 char *ptr = buffer;
215 u32 status; 215 u32 status;
216 int host_remain = host->size;
216 217
217 do { 218 do {
218 int count = host->size - (readl(base + MMCIFIFOCNT) << 2); 219 int count = host_remain - (readl(base + MMCIFIFOCNT) << 2);
219 220
220 if (count > remain) 221 if (count > remain)
221 count = remain; 222 count = remain;
@@ -227,6 +228,7 @@ static int mmci_pio_read(struct mmci_host *host, char *buffer, unsigned int rema
227 228
228 ptr += count; 229 ptr += count;
229 remain -= count; 230 remain -= count;
231 host_remain -= count;
230 232
231 if (remain == 0) 233 if (remain == 0)
232 break; 234 break;
diff --git a/drivers/net/arm/am79c961a.c b/drivers/net/arm/am79c961a.c
index ba6bd03a015f..a637910b02dd 100644
--- a/drivers/net/arm/am79c961a.c
+++ b/drivers/net/arm/am79c961a.c
@@ -693,11 +693,15 @@ static int __init am79c961_probe(struct platform_device *pdev)
693 * done by the ether bootp loader. 693 * done by the ether bootp loader.
694 */ 694 */
695 dev->base_addr = res->start; 695 dev->base_addr = res->start;
696 dev->irq = platform_get_irq(pdev, 0); 696 ret = platform_get_irq(pdev, 0);
697 697
698 ret = -ENODEV; 698 if (ret < 0) {
699 if (dev->irq < 0) 699 ret = -ENODEV;
700 goto nodev; 700 goto nodev;
701 }
702 dev->irq = ret;
703
704 ret = -ENODEV;
701 if (!request_region(dev->base_addr, 0x18, dev->name)) 705 if (!request_region(dev->base_addr, 0x18, dev->name))
702 goto nodev; 706 goto nodev;
703 707
diff --git a/drivers/serial/s3c2410.c b/drivers/serial/s3c2410.c
index 4ffa2585429a..da5a02cb4f63 100644
--- a/drivers/serial/s3c2410.c
+++ b/drivers/serial/s3c2410.c
@@ -1022,6 +1022,7 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
1022 struct uart_port *port = &ourport->port; 1022 struct uart_port *port = &ourport->port;
1023 struct s3c2410_uartcfg *cfg; 1023 struct s3c2410_uartcfg *cfg;
1024 struct resource *res; 1024 struct resource *res;
1025 int ret;
1025 1026
1026 dbg("s3c24xx_serial_init_port: port=%p, platdev=%p\n", port, platdev); 1027 dbg("s3c24xx_serial_init_port: port=%p, platdev=%p\n", port, platdev);
1027 1028
@@ -1064,9 +1065,11 @@ static int s3c24xx_serial_init_port(struct s3c24xx_uart_port *ourport,
1064 1065
1065 port->mapbase = res->start; 1066 port->mapbase = res->start;
1066 port->membase = S3C24XX_VA_UART + (res->start - S3C24XX_PA_UART); 1067 port->membase = S3C24XX_VA_UART + (res->start - S3C24XX_PA_UART);
1067 port->irq = platform_get_irq(platdev, 0); 1068 ret = platform_get_irq(platdev, 0);
1068 if (port->irq < 0) 1069 if (ret < 0)
1069 port->irq = 0; 1070 port->irq = 0;
1071 else
1072 port->irq = ret;
1070 1073
1071 ourport->clk = clk_get(&platdev->dev, "uart"); 1074 ourport->clk = clk_get(&platdev->dev, "uart");
1072 1075