diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2008-10-21 19:39:55 -0400 |
---|---|---|
committer | Samuel Ortiz <samuel@sortiz.org> | 2008-10-21 19:39:55 -0400 |
commit | 7cf5244ce4a0ab3f043f2e9593e07516b0df5715 (patch) | |
tree | 586b307509d611f1b37c4b1af7a6694109f8e3b5 /drivers/mfd/sm501.c | |
parent | 7ab18995e11089ea33c99fd586e8bad4932369e4 (diff) |
mfd: check for platform_get_irq() return value in sm501
sm501_devdata->irq is unsigned, while platform_get_irq() returns a
signed int.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Samuel Ortiz <sameo@openedhand.com>
Diffstat (limited to 'drivers/mfd/sm501.c')
-rw-r--r-- | drivers/mfd/sm501.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index 4d9aaf9501df..170f9d47c2f9 100644 --- a/drivers/mfd/sm501.c +++ b/drivers/mfd/sm501.c | |||
@@ -1374,31 +1374,31 @@ static int sm501_init_dev(struct sm501_devdata *sm) | |||
1374 | static int sm501_plat_probe(struct platform_device *dev) | 1374 | static int sm501_plat_probe(struct platform_device *dev) |
1375 | { | 1375 | { |
1376 | struct sm501_devdata *sm; | 1376 | struct sm501_devdata *sm; |
1377 | int err; | 1377 | int ret; |
1378 | 1378 | ||
1379 | sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL); | 1379 | sm = kzalloc(sizeof(struct sm501_devdata), GFP_KERNEL); |
1380 | if (sm == NULL) { | 1380 | if (sm == NULL) { |
1381 | dev_err(&dev->dev, "no memory for device data\n"); | 1381 | dev_err(&dev->dev, "no memory for device data\n"); |
1382 | err = -ENOMEM; | 1382 | ret = -ENOMEM; |
1383 | goto err1; | 1383 | goto err1; |
1384 | } | 1384 | } |
1385 | 1385 | ||
1386 | sm->dev = &dev->dev; | 1386 | sm->dev = &dev->dev; |
1387 | sm->pdev_id = dev->id; | 1387 | sm->pdev_id = dev->id; |
1388 | sm->irq = platform_get_irq(dev, 0); | ||
1389 | sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1); | ||
1390 | sm->mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
1391 | sm->platdata = dev->dev.platform_data; | 1388 | sm->platdata = dev->dev.platform_data; |
1392 | 1389 | ||
1393 | if (sm->irq < 0) { | 1390 | ret = platform_get_irq(dev, 0); |
1391 | if (ret < 0) { | ||
1394 | dev_err(&dev->dev, "failed to get irq resource\n"); | 1392 | dev_err(&dev->dev, "failed to get irq resource\n"); |
1395 | err = sm->irq; | ||
1396 | goto err_res; | 1393 | goto err_res; |
1397 | } | 1394 | } |
1395 | sm->irq = ret; | ||
1398 | 1396 | ||
1397 | sm->io_res = platform_get_resource(dev, IORESOURCE_MEM, 1); | ||
1398 | sm->mem_res = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
1399 | if (sm->io_res == NULL || sm->mem_res == NULL) { | 1399 | if (sm->io_res == NULL || sm->mem_res == NULL) { |
1400 | dev_err(&dev->dev, "failed to get IO resource\n"); | 1400 | dev_err(&dev->dev, "failed to get IO resource\n"); |
1401 | err = -ENOENT; | 1401 | ret = -ENOENT; |
1402 | goto err_res; | 1402 | goto err_res; |
1403 | } | 1403 | } |
1404 | 1404 | ||
@@ -1407,7 +1407,7 @@ static int sm501_plat_probe(struct platform_device *dev) | |||
1407 | 1407 | ||
1408 | if (sm->regs_claim == NULL) { | 1408 | if (sm->regs_claim == NULL) { |
1409 | dev_err(&dev->dev, "cannot claim registers\n"); | 1409 | dev_err(&dev->dev, "cannot claim registers\n"); |
1410 | err= -EBUSY; | 1410 | ret = -EBUSY; |
1411 | goto err_res; | 1411 | goto err_res; |
1412 | } | 1412 | } |
1413 | 1413 | ||
@@ -1418,7 +1418,7 @@ static int sm501_plat_probe(struct platform_device *dev) | |||
1418 | 1418 | ||
1419 | if (sm->regs == NULL) { | 1419 | if (sm->regs == NULL) { |
1420 | dev_err(&dev->dev, "cannot remap registers\n"); | 1420 | dev_err(&dev->dev, "cannot remap registers\n"); |
1421 | err = -EIO; | 1421 | ret = -EIO; |
1422 | goto err_claim; | 1422 | goto err_claim; |
1423 | } | 1423 | } |
1424 | 1424 | ||
@@ -1430,7 +1430,7 @@ static int sm501_plat_probe(struct platform_device *dev) | |||
1430 | err_res: | 1430 | err_res: |
1431 | kfree(sm); | 1431 | kfree(sm); |
1432 | err1: | 1432 | err1: |
1433 | return err; | 1433 | return ret; |
1434 | 1434 | ||
1435 | } | 1435 | } |
1436 | 1436 | ||